Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two Y-scales in pyqtgraph (twinx-like)

How can I generate a plot with two Y-scales in pyqtgraph?

I also need the two in different colors (corresponding to lines' colors).

enter image description here

In matplotlib it can be done using twinx, as in this example.

If there's no way to do it with a single plot object, perhaps there's a way to overlay a plot (with y-axis on right side) on another one (with the y-axis on left)?

like image 641
shx2 Avatar asked May 15 '14 13:05

shx2


1 Answers

See pyqtgraph/examples/MultiplePlotAxes.py.

The solution is just what you described--overlay two PlotItems.

like image 138
Luke Avatar answered Oct 24 '22 11:10

Luke