Skip to content
Advertisement

Tag: pyqtgraph

PyQt5/Pyqtgraph Get Numpy Array for What is Currently on the Scene

I have a pg.GraphicsLayoutWidget with some images and some ROIs displayed . I would like to get obtain a numpy array for what is currently on the scene, just like the export command in the context menu of the viewbox . Let an arbitrary RGB image (i.e. a numpy array) image be given. For example , I am using https://drive.google.com/drive/folders/1ejY0CjfEwS6SGS2qe_uRX2JvlruMKvPX?usp=sharing

How to plot hour:min time in ISO 8601 time format?

I am trying to plot temperature data points according to their time recording. Note: as you have mentioned t is represented without hour, the reason is that temp been collected in hour:second. t is a string representing the date and time in ISO 8601 format (ref: datetime.datetime.isoformat()) and temp is a floating number. The plot should be in a way

Generating Scatter Plot from a Matrix

I have a code that generates random matrices of 0’s and 1’s, and I’d like to convert these matrices into scatter plots, where the coordinate corresponds to the matrix row/column, and the color of the scatter point corresponds to the value (red if 0, blue if 1 for example). I’ve been able to do this with matplotlib, but my use-case

matplotlib.pyplot.clim counterpart in pyqtgraph

I want to apply a colormap (“hot”) only to a certain range of values of an image. I already know this functionality from matplotlib.pyplot.clim where you have to specify a minimum and a maximum value for the scaling. As I understood it, you should use setLevels([min,max]) for this. I have included a minimal example which shows that both representations are

Hover Tool for plots in Pyqtgraph

I want to have data information shown when hovering over a line in pyqtgraph plots, but can’t get my sigpointsHovered to emit any signal. Here is a simple example of what i tried to do: I have already tried setting “hoverable” = True and read the docs several times, but I honestly have no clue why the sigPointsHovered is not

pyqtgraph: How to add radiobuttons on a figure legend?

I want to control which curves are displayed at the figure by using the radiobuttons floating on the left-top corner, which will work also as a legend. How can I do that? Answer This could be achieved by inheiring pg.LegendItem and overriding addItem method. In it you need to create widgets and place them into layout. You can use QGraphicsProxyWidget

How to move rect in pyqtgraph

I try to have a rect which moves with the mouse pointer. However, I seem to have a problem with calling the paint method. It either doesn’t draw or creates artifacts. The only clean picture I get is with a forced redraw (zoom the graph). Here’s my mwe Answer Just redrawing the contents of an internal QPicture doesn’t affect the

finplot as a widget in layout

I am trying to add finplot, https://pypi.org/project/finplot/, as a widget to one of the layouts in my UI. I created a widget for finplot and added it to the widgets in the layout but I get the following error: Here is the code that I used. Answer The create_plot_widget() function creates a PlotItem that cannot be added to a layout,

Advertisement