Hi,

I was trying to plot a 3D mesh using PyQtGraph and realized that it gives a 
different graph compared to Matplotlib. The data is exactly the same for 
both, and the Matplotlib plot is the correct one. I was wondering why and 
how can I amend this. I am going to use PyQtGraph as it is much faster.
I attached the PyQtgraph plot (black background) and Matplotlib plot (white 
background). Here is the code for both libraries:

# Plot edges
edge_lines = []
for edge in edges:
vertex1 = vertices[edge[0] - 1]
vertex2 = vertices[edge[1] - 1]
edge_lines.append([(vertex1[0], vertex1[1], vertex1[2]),
(vertex2[0], vertex2[1], vertex2[2])])

edge_collection = Line3DCollection(edge_lines, colors='blue')
ax.add_collection3d(edge_collection)

# Set the limits to make the scene larger
ax.set_xlim(min(vertices[:, 0]), max(vertices[:, 0]))
ax.set_ylim(min(vertices[:, 1]), max(vertices[:, 1]))
ax.set_zlim(min(vertices[:, 2]), max(vertices[:, 2]))

plt.show()


# Create a PyQtGraph application
app = QtWidgets.QApplication([])

# Create a PyQtGraph OpenGL plot window
w = gl.GLViewWidget()
w.opts['distance'] = 50
w.show()
edge_item = gl.GLLinePlotItem(pos=edge_lines, color=(0, 0, 1, 1)) # Color 
is blue, RGBA format
w.addItem(edge_item)

# Start the PyQtGraph event loop
app.exec_()



-- 
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/741cae77-e5d0-4b07-99c8-9160b8b69b89n%40googlegroups.com.

Reply via email to