Hi,

  I actually encountered the same kind of error:

Traceback (most recent call last):

File "C:\Users\guillaume\Documents\scripts_python\skimage_blob.py", line 
212, in process_one_image

update_appearence(param, changed)

File "C:\Users\guillaume\Documents\scripts_python\skimage_blob.py", line 
261, in update_appearence

circles.setPoints(int64(blobs[:, 1]), int64(blobs[:, 0]), size = 
int64(blobs[:, 2]))

File 
"c:\applis\miniconda3\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py",
 
line 411, in setPoints

return self.setData(*args, **kargs)

File 
"c:\applis\miniconda3\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py",
 
line 297, in setData

self.addPoints(*args, **kargs)

File 
"c:\applis\miniconda3\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py",
 
line 398, in addPoints

self.updateSpots(newData)

File 
"c:\applis\miniconda3\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py",
 
line 553, in updateSpots

self.fragmentAtlas.getAtlas() # generate atlas so source widths are 
available.

File 
"c:\applis\miniconda3\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py",
 
line 193, in getAtlas

self.buildAtlas()

File 
"c:\applis\miniconda3\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py",
 
line 186, in buildAtlas

self.atlasData[x:x+w, y:y+h] = rendered[key]

TypeError: slice indices must be integers or None or have an __index__ 
method

I found based on your post a way to resolve the problem by adding [y, x, h, 
w] = np.int64([y, x, h, w]) at line 186 and also at line 148 of 
ScatterPlotItem.py file. But I am not found of modifying a file of a module 
as I shared my scripts with other people. Is there a way to prevent the 
problem without modifying ScatterPlotItem.py ?

The problem emerge since I updated numpy and matplotlib with numpy+mkl 
(version 1.12b01) and matplotlib (version 2.0.0rc1) you can find for 
windows x64 here: http://www.lfd.uci.edu/~gohlke/pythonlibs/
In both cases the cp35-cp35m-win_amd64.whl variant.

As you may have guessed with the path to my ScatterPlotItem.py file I am 
using python 3.5 with miniconda.

Thanks in advance for any clue that may help me on this one.

PS: in case someone want to reply me to change to an older version or keep 
miniconda version of numpy and matplotlib: these version raise a bug 
implying cycler in matplotlib with skimage blobs functions if I do not 
update the packages. So I am stuck on this one.

Le jeudi 25 février 2016 06:35:27 UTC+1, Yang Shize a écrit :
>
> Problem Description:
> I copied the basic plotting example to a .py file and then run it.
> Then the following error appears.
>
>
> Traceback (most recent call last):
>   File "D:\Python35\Quantifit-0975-150729\pyqttest4.py", line 36, in 
> <module>
>     p3.plot(np.random.normal(size=100), pen=(200,200,200), 
> symbolBrush=(255,0,0), symbolPen='w')
>   File 
> "D:\Python35\lib\site-packages\pyqtgraph\graphicsItems\PlotItem\PlotItem.py", 
> line 630, in plot
>     item = PlotDataItem(*args, **kargs)
>   File 
> "D:\Python35\lib\site-packages\pyqtgraph\graphicsItems\PlotDataItem.py", 
> line 176, in __init__
>     self.setData(*args, **kargs)
>   File 
> "D:\Python35\lib\site-packages\pyqtgraph\graphicsItems\PlotDataItem.py", 
> line 460, in setData
>     self.updateItems()
>   File 
> "D:\Python35\lib\site-packages\pyqtgraph\graphicsItems\PlotDataItem.py", 
> line 492, in updateItems
>     self.scatter.setData(x=x, y=y, **scatterArgs)
>   File 
> "D:\Python35\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py", 
> line 297, in setData
>     self.addPoints(*args, **kargs)
>   File 
> "D:\Python35\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py", 
> line 398, in addPoints
>     self.updateSpots(newData)
>   File 
> "D:\Python35\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py", 
> line 553, in updateSpots
>     self.fragmentAtlas.getAtlas() # generate atlas so source widths are 
> available.
>   File 
> "D:\Python35\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py", 
> line 193, in getAtlas
>     self.buildAtlas()
>   File 
> "D:\Python35\lib\site-packages\pyqtgraph\graphicsItems\ScatterPlotItem.py", 
> line 186, in buildAtlas
>     self.atlasData[x:x+w, y:y+h] = rendered[key]
> IndexError: invalid slice
>

-- 


*This message and any attachments is intended for the named addressee(s) 
only and may contain information that is privileged and/or confidential. If 
you receive this message in error, please delete it and immediately notify 
the sender. Any copying, dissemination or disclosure, either whole or 
partial, by a person who is not the named addressee is prohibited. We use 
virus scanning software but disclaim any liability for viruses or other 
devices which remain in this message or any 
attachments.*******************************Ce message, ainsi que toute 
piece jointe, est exclusivement adresse au(x) destinataire(s) nomme(s) et 
peut contenir des informations confidentielles. Si vous recevez ce message 
par erreur, merci de le detruire et d'en avertir immediatement l'emetteur. 
Toute copie, transmission ou divulgation, integrale ou partielle, par une 
personne qui n'est pas nommee comme destinataire est interdite. Nous 
utilisons un logiciel anti-virus mais nous denions toute responsabilite au 
cas ou des virus, ou tout autre procede, seraient contenus dans ce message 
ou toute piece jointe.*

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/9c58db83-4d93-4950-9ab8-2ffb1f166391%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to