Page 1 of 1

Plotshape question

Posted: Sat May 13, 2023 5:20 pm
by wlkath
Hi all!

Does anyone have an idea why (https://www.neuron.yale.edu/neuron/stat ... class.html)

Code: Select all

from neuron import h
from matplotlib import pyplot
h.load_file('c91662.ses')  
for sec in h.allsec():
    if 'apic' in str(sec):
        sec.v = 0
ps = h.PlotShape(False)  
ps.plot(pyplot)
pyplot.show()
produces a completely blank plot (as far as I can tell) but

Code: Select all

from neuron import h
from matplotlib import cm
import plotly
h.load_file('c91662.ses')  
for sec in h.allsec():
    if 'apic' in str(sec):
        sec.v = 0
ps = h.PlotShape(False)  
ps.plot(plotly, cmap=cm.cool).show()
works OK?

Environment:
MacOS 12.6.5 (arm64)
python=3.11.3
neuron=8.2.2 (installer package)
matplotlib=3.7.1
plotly=5.14.1

Tests of matplotlib by itself (e.g., https://matplotlib.org/3.1.1/gallery/li ... _plot.html) work fine.

Thanks very much!

Re: Plotshape question

Posted: Tue May 16, 2023 11:44 am
by ted
So this bug bit you too, Bill! It was just recently discovered, and the cause and fix are yet to be determined. Meanwhile, we're fortunate that other Python libraries, e.g. plotly, do work properly with NEURON.

Re: Plotshape question

Posted: Tue May 16, 2023 12:04 pm
by wlkath
Thanks for confirming. I recently needed to reinstall python and I thought that maybe I was still having issues.