brian-team / brian2

Brian is a free, open source simulator for spiking neural networks.
http://briansimulator.org
Other
933 stars 220 forks source link

Plotting results of multicompartmental simulations #629

Closed romainbrette closed 6 months ago

romainbrette commented 8 years ago

A basic difficulty when analyzing results of multicompartmental simulations is that we typically want to look at functions of two variables, t and x. Currently the only way to visualize the results is to do lots of plots. Let us say we want to visualize V(x,t). I suggest two ideas.

The first idea is to use linked plots, one for each coordinate. That is, one plot displays V(x0,t), another one displays V(x,t0). When one clicks on the first graph, a new time t0 is selected and the second graph is updated; conversely when clicking on the second graph. It seems relatively simple. One may add a slider next to each plot to change x0 (in the first graph) or t0 (in the second one).

The second idea, which is more appropriate for branched structures, is to have one plot displaying V(x0,t), and a clickable dendrogram linked to the first plot (click on it to change x0 and update the graph).

romainbrette commented 8 years ago

P.S.: for the first idea, the code needs not be specific of multicompartmental models; it is just a way of visualizing functions of two variables.

mstimberg commented 8 years ago

I think this would be interesting features to have somewhere, but I would not include it in the main Brian 2 repository. We decided in the beginning to not include plotting/analysis tools (Morphology.plot already violates this rule, though...) and to concentrate on the core, otherwise we would certainly have things like raster_plot which were in Brian 1. But I am sure many users would find it useful to have such tools available in some easy way. Our plan was always to use the brian2cookbook for "non-core" code related to Brian but this never really took off... I think that plotting tools are of quite high importance, so maybe we'll have a new repository just for them (say, brian2plotting)? In the ideal case, this could even have our own high-level plotting code that would be independent of the backend, i.e. it could have different implementations of something like raster_plot for matplotlib, bokeh, ... Speaking about bokeh and other tools: many of those new tools are built around browsers and javascript and offer things like linked plots almost for free, e.g. see these examples: http://bokeh.pydata.org/en/0.10.0/docs/user_guide/interaction.html#linked-brushing http://mpld3.github.io/examples/linked_brush.html (both are about linked brushing which is not quite what you want, but you get the idea). These tools are also quickly evolving, though, so I'd rather not depend on them in the core Brian 2 package.

Another advantage of a separate repository: this is an area where others could easily contribute, without all the daunting complexity of the main Brian 2 codebase around it (and just from a practial point of view it would also be nice if not each plotting-related commit triggers the Brian 2 test suite which will then take 2h to run...)

romainbrette commented 8 years ago

Excellent suggestion. Bokeh does look very nice. We could have indeed another repository for plotting/visualisation, or perhaps more generally tools.

Le 15/01/2016 19:11, Marcel Stimberg a écrit :

I think this would be interesting features to have somewhere, but I would not include it in the main Brian 2 repository. We decided in the beginning to not include plotting/analysis tools (|Morphology.plot| already violates this rule, though...) and to concentrate on the core, otherwise we would certainly have things like |raster_plot| which were in Brian 1. But I am sure many users would find it useful to have such tools available in some easy way. Our plan was always to use the |brian2cookbook| for "non-core" code related to Brian but this never really took off... I think that plotting tools are of quite high importance, so maybe we'll have a new repository just for them (say, |brian2plotting|)? In the ideal case, this could even have our own high-level plotting code that would be independent of the backend, i.e. it could have different implementations of something like |raster_plot| for matplotlib, bokeh, ... Speaking about bokeh and other tools: many of those new tools are built around browsers and javascript and offer things like linke d plots almost for free, e.g. see these examples: http://bokeh.pydata.org/en/0.10.0/docs/user_guide/interaction.html#linked-brushing http://mpld3.github.io/examples/linked_brush.html (both are about linked brushing which is not quite what you want, but you get the idea). These tools are also quickly evolving, though, so I'd rather not depend on them in the core Brian 2 package.

Another advantage of a separate repository: this is an area where others could easily contribute, without all the daunting complexity of the main Brian 2 codebase around it (and just from a practial point of view it would also be nice if not each plotting-related commit triggers the Brian 2 test suite which will then take 2h to run...)

— Reply to this email directly or view it on GitHub https://github.com/brian-team/brian2/issues/629#issuecomment-172040186.

mstimberg commented 6 months ago

This should be handled in brian2tools, which already has some basic support here: https://brian2tools.readthedocs.io/en/stable/user/plotting.html#plotting-neuronal-morphologies