I am experiencing issues with h.PlotShape. Following the tutorial https://nrn.readthedocs.io/en/8.2.4/tut ... ick-1.html
I wrote this code on Ubuntu 22.04 python 3.10.12 and NEURON 8.2.4 (in a virtual environment):
Code: Select all
from neuron import h
from neuron.units import ms, mV, µm
h.load_file("stdrun.hoc")
class BallAndStick:
def __init__(self, gid):
self._gid = gid # identifier gid
self.soma = h.Section(name="soma", cell=self)
self.dend = h.Section(name="dend", cell=self)
self.dend.connect(self.soma) # connect the sections
# different from connect soma to dend; instead it means dendrite begins where soma ends
self.soma.L = self.soma.diam = 12.6157 * µm
self.dend.L = 200 * µm
self.dend.diam = 1 * µm
def __repr__(self):
return "BallAndStick[{}]".format(self._gid)
my_cell = BallAndStick(0)
h.topology()
my_cell.soma(0.5).area() # only returns areas of segments. since there is only one segment, this is whole area
import matplotlib
matplotlib.use('QT5Agg') # Use 'Qt5Agg' or another backend if preferred
import matplotlib.pyplot as plt
h.PlotShape(False).plot(plt)
Code: Select all
plt.show()
Before using Linux, I was on Anaconda Windows11 Python 3.11, NEURON 8.2.4; the code and error message was exactly same as viewtopic.php?t=4449
I reinstalled Windows, reset the whole system, checked my hardware (Windows Memory Diagnostic), but the error persists.
It would be much appreciated if anyone could help. I will provide any detail needed to solve this problem and test all suggested codes you provide.