Hi.
You are probably missing that your line and scatter plot coordinates
overlaps and to they have the same color parameters. Try to change those
parameters as:
*import numpy as npimport pyqtgraph as pgimport pyqtgraph.opengl as
glimport numpy as npv = pg.Qt.QtGui.QApplication([])w =
gl.GLViewWidget()w.setWindowTitle('pyqtgraph example: GLSurfacePlot')## Add
a grid to the viewg = gl.GLGridItem()w.addItem(g)## Add Axisa =
gl.GLAxisItem()w.addItem(a)# add a lineel2 =
gl.GLLinePlotItem(pos=np.array([[0, 1, 0], [1, 1, 1], [1.5, 1.3, 1.2]]),
color=[1, 1., 1., 1.], width=10)w.addItem(el2)# add scatter plotsel1 =
gl.GLScatterPlotItem(pos=np.array([[0, 0, 1], [2, 2, 2],[3, 2, 3], [3, 3,
4]]), color=[1, 0.0, 1., 1.], size=10)w.addItem(el1)w.show()while
w.isVisible(): v.processEvents();*
On Mon, Jul 15, 2019 at 5:06 PM Evangelos Petsalis <[email protected]>
wrote:
> Hi,
>
> I am new to using PyQTGraph but I encountered a very weird issue.
> Every time I add a ScatterPlotItem, while there is n existing
> LinePlotItem, the LinePlotItem disappears.
> Here is the sample code that I run.
>
> I am sure I am missing something very simple, but any help would greatly
> be appreciated.
>
> Thanks in advance for the help.
>
>
>
>
> import matplotlib.pyplot as plt
> from mpl_toolkits.mplot3d import Axes3D
> import numpy as np
> from pyqtgraph.Qt import QtCore, QtGui
> import pyqtgraph as pg
> import pyqtgraph.opengl as gl
> import pyqtgraph.examples as ex
> import numpy as np
> import sys
>
> app = QtGui.QApplication([])
> w = gl.GLViewWidget()
> w.setWindowTitle('pyqtgraph example: GLSurfacePlot')
>
> ## Add a grid to the view
> g = gl.GLGridItem()
> w.addItem(g)
>
> ## Add Axis
> a = gl.GLAxisItem()
> w.addItem(a)
>
> # add a line
> el2 = gl.GLLinePlotItem(pos=np.array([[0, 0, 1], [1, 1, 1]]), color=[1, 0.0,
> 1., 1.], width=10)
> w.addItem(el2)
>
> # add scatter plots
> el1 = gl.GLScatterPlotItem(pos=np.array([[0, 0, 1], [1, 1, 1]]), color=[1,
> 0.0, 1., 1.], size=10)
> w.addItem(el1)
>
> w.show()
>
> --
> 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/d6c54eb5-8188-4267-8449-d17c6dd9e7ac%40googlegroups.com
> <https://groups.google.com/d/msgid/pyqtgraph/d6c54eb5-8188-4267-8449-d17c6dd9e7ac%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CAD_qyJrTFJqcfVwGvbtDtXLdXsKxygEs9b5Y0ZPAREjTXVLjbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.