pygwalker
pygwalker copied to clipboard
How to make a histogram
How do you make a histogram chart of one attribute (column)? (without pre-calculating the histogram data before putting the data into pygwalker, of course)
I fiddled with the UI for a while but couldn't find a way. If it's not possible right now, I'd like it to be implemented.
Thanks

Suppose you have a field score, click the dropdown icon of the score field in the measure segment, there will be some transformations you can make, click the bin transformation option. and it create a new filed bin(score) in dimension segment.
use bin(score) as the x-axis and row count as the y-axis and you can get a histogram.
It is not a perfect enough design, I am considering making the field editable so that you can write the expression bin or other computations more easily.
Thanks for the quick answer! Awesome that it's implemented already, but I think it'd be great if you could adjust the number of bins, and also if the labels showed exactly what value range each bin represent (e.g. 0-20, 20-40, 40-60)
(and yeah, custom expressions would be awesome too)
I second this, it would be very helpful to be able to select the number of bins for a histogram. I need the histogram in one of the projects I am working on, but can't use Pygwalker for it yet...
graphic-walker has supported this feature, will be updated to pygwalker this week @longxiaofei
I have two problems with bins:
- I can't find where is this setting of number of bins? how to get there?
- why the histogram is not maximized by default?
Looks like I found where it is: at the creation time of a new field. But if I want to change the existing field - I cannot do this.