Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

SyncLines not working in Tutorial 7

59 views
Skip to first unread message

Ivan Shevchenko

unread,
May 2, 2023, 4:31:27 PM5/2/23
to NetPyNE Q&A forum
Hi all,

I'm having trouble with getting SyncLines to show up on the raster plot in tutorial 7. Downloading tut7.py from


the raster plot doesn't even show to begin with. It gives the following error:

Plotting raster...
  There was an exception in plotRaster():
    'NoneType' object has no attribute 'plot
.

To fix this error, I needed to comment out line 55:

simConfig.analysis['plotRaster'] = {'syncLines': True, 'saveFig': True}      # Plot a raster ,

and instead put the following line somewhere after line 77:

sim.analysis.plotRaster(timeRange=[0,500],syncLines=True,saveFig=True) ,

which is an alternative way of plotting the raster plot. This fixes the error I was getting before, and I am now getting the raster plot to show up, but it doesn't have any SyncLines plotted. I have also tried plotting SyncLines on some of the other tutorial files, but I run into the same issues. Running the code

print(sim.allSimData['spkt'])

confirms that the spike times are working as intended, so this likely isn't the problem. Any help would be appreciated.

Best,
Ivan

Valery Bragin

unread,
May 8, 2023, 2:46:36 PM5/8/23
to NetPyNE Q&A forum
Hi Ivan,

Thanks for helping to identify the issue! The fix is now available in development version, which you can access by cloning the repo locally and installing it using `pip install -e /path/where/it/was/cloned`.

Best regards,
Valery

Reza

unread,
May 21, 2024, 10:06:50 AM5/21/24
to NetPyNE Q&A forum
Hi all,

I have a similar issue here and cannot have the raster plot, as you can see below. 
[

There was an exception in plotRaster()
Plotting recorded cell traces ... cell
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/netpyne/analysis/utils.py", line 87, in wrapper 
     return function(*args, **kwargs) 
  File "/usr/local/lib/python3.10/dist-packages/netpyne/plotting/plotRaster.py", line 395, in plotRaster
     rasterPlotter.axis.vlines(spkTimes, 0, len(cellInds), 'red', linewidth=0.1)
NameError: name 'cellInds' is not defined
]



I have to use sim.analysis.plotRaster() to see the plot but it has no syncLines and other information above the raster plot.
Preparing spike data... Plotting raster...


Valery Bragin

unread,
May 31, 2024, 4:40:04 AM5/31/24
to NetPyNE Q&A forum
Hi all,

I missed one step in installation instructions, sorry about that. The fix is currently available in `development` branch only, so once you cloned the repo to your machine, you have to `cd` there, and do `git checkout development` (and then `git pull` to make sure you're up to date). Hope this helps, sorry again!

Best regards,
Valery

Reza

unread,
May 31, 2024, 5:38:26 AM5/31/24
to NetPyNE Q&A forum
Hi Valery
Thank you for your time.
I have done all the above but it seems I still have issues plotting the raster plot.

[!git clone https://github.com/Neurosim-lab/netpyne.git
%cd netpyne
!git checkout development
!git pull
!pip install -e .
# ---------------------------------------------
# cd /content/netpyne/netpyne/plotting/
!pip install -e /content/netpyne/]

(....
....
"Successfully installed netpyne-1.0.6")

Please see the shot below. 


Screenshot 2024-05-31 at 10.33.52.png

I would be grateful if you could guide me with that.
Thank you.

Reza
Reply all
Reply to author
Forward
0 new messages