Giorgi Bakhtadze
2018-09-05 06:10:40 UTC
Hello,
I don't know if this is right place to post this because it is not question
but suggestion. As you might know GLSurfacePlotItem takes x and y one
dimensional arrays and creates meshgrid (or something with same
functionality) object. But if you need to plot parametric surface (or
surface with any coordinate system other than Cartesian) then
GLSurfacePlotItem cannot be used because its x and y must be one
dimensional. I found very simple workaround an just wanted to share because
plotting parametric equation isn't directly possible as I know (It is
possible if you use GLMeshItem but you have to create MeshData manually).
My workaround is very simple: in file
"pyqtgraph\opengl\items\GLSurfacePlotItem.py" on lines 106 and 115 you have
to remove reshape function like this:
instead of "self._vertexes[:, :, 0] = x.reshape(len(x), 1)" there should be
just self._vertexes[:, :, 0] = x and same for line 115 for y axis.
I wouldn't suggest modifying source files but I think developers should
change it or just add another option that takes this kind of arguments as
variables.
I don't know if this is right place to post this because it is not question
but suggestion. As you might know GLSurfacePlotItem takes x and y one
dimensional arrays and creates meshgrid (or something with same
functionality) object. But if you need to plot parametric surface (or
surface with any coordinate system other than Cartesian) then
GLSurfacePlotItem cannot be used because its x and y must be one
dimensional. I found very simple workaround an just wanted to share because
plotting parametric equation isn't directly possible as I know (It is
possible if you use GLMeshItem but you have to create MeshData manually).
My workaround is very simple: in file
"pyqtgraph\opengl\items\GLSurfacePlotItem.py" on lines 106 and 115 you have
to remove reshape function like this:
instead of "self._vertexes[:, :, 0] = x.reshape(len(x), 1)" there should be
just self._vertexes[:, :, 0] = x and same for line 115 for y axis.
I wouldn't suggest modifying source files but I think developers should
change it or just add another option that takes this kind of arguments as
variables.
--
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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/feeaced7-ac41-4936-b095-887463db8e57%40googlegroups.com.
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 pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/feeaced7-ac41-4936-b095-887463db8e57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.