Plot - add side histograms
DanielAndreasen opened this issue · comments
Should it always be shown or activated by another checkbox?
I think it makes sense to always have on
Ok, I created a branch to start this.
Only un-duplicated the plotting code so far in a420902.
I have added the histograms in e69daf4. But they are not fully interactive like the example above.
They do not update with fancy shaded selection/non-selection histograms when points are selected.
I believe this is because we embed the bokeh components through script
and div
, and not actually running a bokeh server.
Any suggestions on where to go from here?
I think it looks fine. And if you correct for my comment in the commit, I think it should be ready to merge.
We can work on it to be more interactive later (maybe).
The histogram axis also needs to be changed to reflect the user selected axis scale! Here is a numpy example for log bin spacing, but maybe there is something in bokeh
Also, I just noticed that I left hh1 and hh2 uncommented, they are for the update stuff, so don't do anything at the moment.
Yes, I was just about to comment on the scale as well!
Okay, it is relatively easy to accomplish. For the default SC+exo plot (year vs planet mass), these two lines (265 and 270) fixes it:
vhist, vedges = np.histogram(y, bins=np.logspace(-4, 3, 50))
...
pv = figure(toolbar_location=None, plot_width=200, plot_height=fig.plot_height,
x_range=(-vmax*0.1, vmax), y_range=fig.y_range, min_border=10,
y_axis_location="right", y_axis_type='log')
It should be relatively simple to do this automatically.
Alright, this should have been fixed with commit 34ee8aa
All done