0

I have a large gui app based on matplotlib which is horribly slow (on windows) so I am trying to re-host it on pyqtgraph (which seems to be much faster).

I am facing the following problem: I need to plot very different things (vastly different ranges, axes formatting &c: e.g., sometimes X is $$ from 0 to 1B and sometimes X is time from midnight to now, and sometimes date from last year to now) in the same screen area.

With matplotlib I re-use the same Axes object (pre-inserted in the subplot2grid), because after ax.clear() it is as new and I can set axis formatters and the ax.plot sets xlim and ylim correctly.

With pyqtgraph re-using is much harder because I cannot reset axisItems in a PlotWidget, and pw.clear() does not remove title, axis labels, grids, ticks.

Should I create a new PlotWidget for each plot type and replace it in the layout?

2
  • I have no idea how looks your plot but I would use new PlotWidget for each plot (especially if it is simpler) Commented Jul 23 at 14:48
  • In the Initializer, you can create empty PlotDataItems for each type of data you are going to use, and then, when you need to plot, for example, a Date data, you can change the data inside and add it to the PlotWIdget Commented Aug 4 at 13:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.