2013-10-16 31 views
2

是我還是不可能繪製pyqtgraph中的點(scatterplot)使用Python 3.3?Python 3.3 pyqtgraph無法繪製點

我有相當大的數據*,並找到matplotlib太慢,所以我想試試這個:

1)pyqtgraph.plot([1],[1])說明不了什麼的情節。

2)pyqtgraph.plot([1,2,3,4], [1,2,3,4])示出了連接點

3)pyqtgraph.plot([1,2,3,4], [1,2,3,4], pen=None)線通過文檔的建議,錯誤**

4)pyqtgraph.ScatterPlotItem()不存在。

我不知道該怎麼嘗試了......有沒有人得到這個工作,並願意分享代碼?


*我知道我提出的數據的諷刺意味,原諒我。

** TypeError:不支持的操作數類型爲 - :'NoneType'和'NoneType'。

***也許不相關,但我也無法獲得運行的例子(Ubuntu 13.04)。打印時

+0

您應該更改標籤,以便獲取實際使用的庫,而不是您未使用的庫。 – tacaswell

+1

@tcaswell採取的「點」。 – PascalVKooten

+0

您應該發送到pyqtgraph郵件列表,瞭解有關運行示例的麻煩。 – Luke

回答

4

創建散點圖正確的方式或者是通過指定符號屬性(符號,symbolPen,symbolBrush,symbolSize;見PlotDataItem API):

pg.plot([1,2,3,4], [1,2,3,4], pen=None, symbol='o') 

,或者直接創建ScatterPlotItem,其好像在我結束存在:

>>> import pyqtgraph as pg 
>>> pg.ScatterPlotItem 
<class 'pyqtgraph.graphicsItems.ScatterPlotItem.ScatterPlotItem'> 

參見如何使用後一種方法examples/ScatterPlot.py