Discussion:
[pyqtgraph] graph alignment
Stefan Seefeld
2018-09-28 01:42:02 UTC
Permalink
Hi all,

I'm using a GraphicsLayoutWidget to arrange multiple plots side-by-side.
Now I'd like to align multiple plots horizontally (i.e. stack them
vertically) such that they can all share the same X axis. The alignment
I now get (simply calling `nextRow()` between plots) results in a slight
(Y axis) misalignment due to the fact that the Y axis tic labels require
different amounts of space in the various plots depending on the values
to be printed there.

Is there a way to align the Y axes explicitly ?

Thanks,


Stefan

--

...ich hab' noch einen Koffer in Berlin...
--
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/19d4878b-119c-6337-4139-69b733ffb85e%40seefeld.name.
For more options, visit https://groups.google.com/d/optout.
t***@gmail.com
2018-09-29 08:55:40 UTC
Permalink
Hi Stefan,

You can set width of the Y-Axis for each of your subplot using setWidth
under AxisItem.
Post by Stefan Seefeld
import pyqtgraph as pg
graphic_window = pg.GraphicsWindow()
graphic_window.nextRow()
p = graphic_window.addPlot()
p.getAxis('left').setWidth(120)
http://www.pyqtgraph.org/documentation/graphicsItems/axisitem.html
Post by Stefan Seefeld
Hi all,
I'm using a GraphicsLayoutWidget to arrange multiple plots side-by-side.
Now I'd like to align multiple plots horizontally (i.e. stack them
vertically) such that they can all share the same X axis. The alignment I
now get (simply calling `nextRow()` between plots) results in a slight (Y
axis) misalignment due to the fact that the Y axis tic labels require
different amounts of space in the various plots depending on the values to
be printed there.
Is there a way to align the Y axes explicitly ?
Thanks,
[image: Stefan]
--
...ich hab' noch einen Koffer in Berlin...
--
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/832f37e1-d81b-43a9-b212-0d07259d259d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...