question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom histogram plotting

See original GitHub issue

Hi @marcomusy,

I am trying to follow the example from here in order to plot a similar to the following histogram graph:

image

However, I am not sure whether it is possible to have the range of the bins given. I’ve tried the following but didn’t really work:

import os
import numpy as np
import pandas as pd
import vedo as vd
from vedo.pyplot import histogram, plot, settings

LUX_BINS = [100, 250, 500, 750, 1000, 2000, 5000, 10000]

data = pd.read_csv("ls_room_999.csv", header=None, delimiter=',', low_memory=False).to_numpy(dtype='float')

cluster_ids_x = np.digitize(data[:,4].reshape(-1, 1), LUX_BINS)
classes, class_counts = np.unique(cluster_ids_x, return_counts=True)
points_percentage = class_counts * 100 / cluster_ids_x.size

plt = histogram(data[:, 4], title="hist", bins=LUX_BINS, density=False, c='cyan3', aspect=8 / 7)
plt.show(size=(800, 700), zoom=1.2, interactorStyle="Image").close()

Is it possible to have the ranges of the bins given and accordingly apply it to the hist?

Thanks.

ls_room_999.csv

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ttsesmcommented, May 15, 2021

Νοpe, please feel free.

(I will close this now)

1reaction
marcomusycommented, May 15, 2021

You should educate them LOL Would you mind if I add a simplified version of this among the pyplot examples?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Free Histogram Maker - Create Histograms Like a Pro | Visme
Fully customizable histogram maker with premade templates. Download as a single chart or save as a content block to add to a project....
Read more >
Python Histogram Plotting: NumPy, Matplotlib, Pandas ...
In this tutorial, you'll be equipped to make production-quality, presentation-ready Python histogram plots with a range of choices and features.
Read more >
Histogram maker - Statistics Kingdom
Histogram maker. Creates histogram with customization options like bin size, colors, min, max and the option to remove outliers.
Read more >
Creating Custom Histograms With Weights & Biases - Wandb
Log a custom histogram—sort a list of values into bins by count/frequency of occurrence—natively in a few lines.
Read more >
Easy Histogram Maker
Creates an editable histogram that represent a frequency distribution. Calculates mean, standard deviation, and so on.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found