mcdougallab / matlabneuroninterface

Interface for connecting NEURON and MATLAB
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

RangeVarPlot.plot #6

Closed ramcdougal closed 1 year ago

ramcdougal commented 3 years ago

Despite the name, most methods of a RangeVarPlot do not involve graphics; only .color and .plot do.

The Python graphics solution for RangeVarPlot.plot simply queries the RangeVarPlot for data when it is time to plot; this does not require new queries into the NEURON internals.

Together with #3 this is one of the two NEURON-specific graph types.

edovanveen commented 1 year ago

Initialize with axon = n.Section("axon"); rvp = n.RangeVarPlot(axon, "v"). plot is currently not regnized as a method of RangeVarPlot - it does not show up when calling clib.neuron.get_class_methods("RangeVarPlot"). It is listed as a generic neuron function of type 280-0.

ramcdougal commented 1 year ago

Correct.

For Python we made plot a special case for both RangeVarPlot and PlotShape; see https://github.com/neuronsimulator/nrn/blob/master/src/nrnpython/nrnpy_hoc.cpp#L1005 and then https://github.com/neuronsimulator/nrn/blob/master/src/nrnpython/nrnpy_hoc.cpp#L1062 and following... basically what happens is that if plot is called, it calls back into Python to actually make the graph.

For the MATLAB interface, presumably C++ would never even need to know that a .plot was called, and MATLAB could just catch that special case and handle it directly.

edovanveen commented 1 year ago

Current output (needs some x/y axes labels...):

neuron_rangevarplot

ramcdougal commented 1 year ago

I don't think the existing NEURON interfaces give it any default axis labels.... I think you usually have to add them, because it's not particularly clear what would be the right thing to put... and you could imagine someone might plot multiple rangevarplots on the same axis.