pygwalker icon indicating copy to clipboard operation
pygwalker copied to clipboard

How to make a histogram

Open karamari opened this issue 2 years ago • 3 comments

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

karamari avatar Feb 21 '23 07:02 karamari

example

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.

ObservedObserver avatar Feb 21 '23 13:02 ObservedObserver

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)

karamari avatar Feb 22 '23 01:02 karamari

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...

ilyanoskov avatar Mar 05 '23 14:03 ilyanoskov

image

graphic-walker has supported this feature, will be updated to pygwalker this week @longxiaofei

ObservedObserver avatar Sep 13 '23 01:09 ObservedObserver

I have two problems with bins:

  1. I can't find where is this setting of number of bins? how to get there?
  2. why the histogram is not maximized by default?

ibobak avatar Mar 19 '24 13:03 ibobak

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.

ibobak avatar Mar 19 '24 13:03 ibobak