Hey Luke, first of all thanks for the great package. I am working in a AI domain and plotted my 3D Latent Space embeddings with opengl and it just looks amazing.
If you could help me out with this one problem I would be very happy:-) I am trying to have a 3D Plot and a 2D Plot below. My 2D Plot additionally has a LinearRegionItem and updates the colors of my 3D plot depending on the region specified. I got this working for two 2D plots^^. Do you think this works out for 3D and 2D somehow, and if not would it be possible to add to the 3D plot a input field where I could specify the threshold value for the colors on my 3D plot? Best regards, Magnus Am Sonntag, 12. Januar 2014 17:01:18 UTC+1 schrieb Luke Campagnola: > > On Sat, Jan 11, 2014 at 10:56 PM, Rodrigo Amestica <[email protected] > <javascript:>> wrote: > >> At Sat, 11 Jan 2014 20:03:41 -0500, >> Luke Campagnola wrote: >> > >> > [1 <text/plain; ISO-8859-1 (7bit)>] >> > >> > [2 <text/html; ISO-8859-1 (quoted-printable)>] >> > On Sat, Jan 11, 2014 at 6:24 PM, Rodrigo Amestica <[email protected] >> <javascript:>> wrote: >> > >> > I'm trying to display together 2 items. One is a plot with respect >> to time of a few scalar variables (PlotWidget). The >> > second is a 3D axis mesh that re-orients (rotate) every time there >> is more data available (GLGridItem). >> > >> > Short of an explicit example I came up with the code shown below. >> > >> > The problem I have is that the 3D widget starts with a size of zero >> and, therefore, it is not visible. Instead, if >> > immediately after instantiating the GLViewWidget then I set its >> minimum size (view.setMinimumSize) to some meaningful >> > size then the widget is visible together with the 2D plot. >> > >> > Why is that the layout is not 'sizing' the 3D widget automagicaly >> to the right size? Is it really okay to mix GL and >> > non GL widgets? >> > >> > Thanks, >> > Rodrigo >> > >> > from pyqtgraph.Qt import QtGui, QtCore >> > import pyqtgraph as pg >> > import pyqtgraph.opengl as gl >> > app = QtGui.QApplication([]) >> > w = QtGui.QWidget() >> > layout = QtGui.QGridLayout() >> > w.setLayout(layout) >> > plot = pg.PlotWidget() >> > view = gl.GLViewWidget() >> > #view.setMinimumSize(384,360) >> > xgrid = gl.GLGridItem() >> > view.addItem(xgrid) >> > layout.addWidget(plot, 0, 0) >> > layout.addWidget(view, 2, 0) >> > w.show() >> > >> > The problem here is that the PlotWidget and the GLViewWidget are >> competing for space in the layout, and the PlotWidget has >> > more aggressive default settings because it inherits from >> QGraphicsView. To be honest, I have never really understood Qt's >> > layout system, but there is an easy workaround if you want to force two >> widgets to share space equally: make their >> > sizePolicy the same, and make them both return the same value for >> sizeHint: >> > >> > plot.sizeHint = view.sizeHint = lambda: pg.QtCore.QSize(100, 100) >> > view.setSizePolicy(plot.sizePolicy) >> > >> > Luke >> >> just like that the second line did not work. Replaced sizePolicy by >> sizePolicy() >> and now it works. Which seems to make sense after checking that sizePolicy >> returns a QSizePolicy value. >> > > Correct; my mistake. > > >> The '100' values have an effect on the initial size of the frame, which >> means >> that some logic (take into account the total number of widgets at the >> end) would >> be needed for a more comfortable situation right after starting the >> application. >> > > You can either provide sizeHint values that make more sense for your > application, or call `w.resize(w, h)`. > > > Luke > > -- 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/c4fefcf1-4a5b-4c52-bd1c-31a4dac64857%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
