Plotshape question

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
wlkath
Posts: 18
Joined: Wed Jun 08, 2005 12:39 am
Location: Northwestern University
Contact:

Plotshape question

Post 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!
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Plotshape question

Post 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.
wlkath
Posts: 18
Joined: Wed Jun 08, 2005 12:39 am
Location: Northwestern University
Contact:

Re: Plotshape question

Post by wlkath »

Thanks for confirming. I recently needed to reinstall python and I thought that maybe I was still having issues.
Post Reply