hnn-core icon indicating copy to clipboard operation
hnn-core copied to clipboard

Add more options to plot_spikes_hist for HNN-style histograms

Open blakecaldwell opened this issue 4 years ago • 3 comments

Towards the goal of using hnn-core plots in HNN GUI, plot_spikes_hist() would be a good first example. If a suitable function was availble in hnn-core, it would make spikefn.py one step closer to being deprecated (https://github.com/jonescompneurolab/hnn/issues/237)

The HNN spikefn.plot_hist() has some more parameters that aren't found in viz.plot_spikes_hist() in hnn-core: https://github.com/jonescompneurolab/hnn/blob/master/spikefn.py#L235-L247

Basically, HNN needs an enhanced plot_spikes_hist() with tstop (xlim), color specification, histtype, linewidth. This could be a separate function for plotting 'bar' histogram types.

https://github.com/jonescompneurolab/hnn-core/blob/c879ce58d2c57171ded58df3537acdb4a20f708a/hnn_core/viz.py#L51-L73

Example calls are in https://github.com/jonescompneurolab/hnn/blob/master/simdat.py#L340-L353

blakecaldwell avatar Sep 19 '20 01:09 blakecaldwell

I would argue against adding any matplotlib parameters, because users have access to the figure handle. Otherwise, we risk polluting the function signature.

But we can make the defaults match what is there in the GUI, I think that's reasonable.

jasmainak avatar Sep 19 '20 02:09 jasmainak

I think we should add parameters for bins and color because they cannot easily be changed with the figure handle of a histogram.

blakecaldwell avatar Nov 28 '20 16:11 blakecaldwell

we could expose **kwargs that gets passed to ax.hist. So any customization the user wants can be done via that.

jasmainak avatar Nov 28 '20 18:11 jasmainak

@jasmainak is this issue still open?

aritrasinha108 avatar Mar 07 '23 14:03 aritrasinha108