--
-- [ You are subscribed to pyqt...@googlegroups.com. To unsubscribe, send email to pyqtgraph+...@googlegroups.com ]
---
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.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks a lot. I added the following lines to make this work:
self.layout.setRowStretchFactor(0, 0)
self.layout.setRowStretchFactor(1, 13)
self.layout.setRowStretchFactor(2, 8)
On Mon, Mar 18, 2013 at 2:31 PM, Luke Campagnola <luke.ca...@gmail.com> wrote:
On Mon, Mar 18, 2013 at 1:16 PM, Julio Trevisan <juliot...@gmail.com> wrote:
Hi
I have a layout with three rows and 1 column. I would like to set the height of the first row as fixed (title label), and the proportions between the second and third rows as something like 13:8. Please see the code below. I am trying to set the layoutRowStretch property with no effect (the 2nd and 3rd rows do differ in height, but I have no idea how this is determined, since I tried different values with no change in this automatic proportion).
# PlotStack descends from pyqtgraph.GraphicsLayout
class PriceVolumeStack(PlotStack):
def __init__(self, *args, **kwargs):
PlotStack.__init__(self, *args, **kwargs)
p = PricePlot()
p.hideAxis("bottom")
self.addItem(p)
self.nextRow()
self.addItem(VolumePlot())
self.layoutRowStretch = [0, 13, 8]Hello, 'layoutRowStretch' is not a name that is used by GraphicsLayout. It does have a 'layout' attribute, which is a QGraphicsGridLayout (http://qt-project.org/doc/qt-4.8/qgraphicsgridlayout.html). So you could probably call self.layout.setRowStretchFactor(...) to achieve the effect you're after.Luke
--
-- [ You are subscribed to pyqt...@googlegroups.com. To unsubscribe, send email to pyqtgraph+unsubscribe@googlegroups.com ]
---
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+unsubscribe@googlegroups.com.
Still on this old thread. I recently decided to fine-tune the ratio between the heights of two plots that I have stacked using QGraphicsGridLayout::setRowStretchFactor().Although changing the proportion (first plot factor)/(second plot factor) produces a visual change, the proportion is not respected exactly. I find dealing with Qt layouts confusing, likely I am missing something here.
Could you please help me to sort this out? Attached are two screenshots. I attempted the proportions 9/9 and 9/11. In the 9/9 case, I expected both plots to have the same height, but they don't (they nearly do in the 9/11 case, when the second one should be higher). Does it have something to do with the fact that I hid the x-axis in the first plot?
On Wed, Jul 2, 2014 at 9:23 PM, Julio Trevisan <juliot...@gmail.com> wrote:
Still on this old thread. I recently decided to fine-tune the ratio between the heights of two plots that I have stacked using QGraphicsGridLayout::setRowStretchFactor().Although changing the proportion (first plot factor)/(second plot factor) produces a visual change, the proportion is not respected exactly. I find dealing with Qt layouts confusing, likely I am missing something here.You are not missing anything; Qt layouts are confusing.
Could you please help me to sort this out? Attached are two screenshots. I attempted the proportions 9/9 and 9/11. In the 9/9 case, I expected both plots to have the same height, but they don't (they nearly do in the 9/11 case, when the second one should be higher). Does it have something to do with the fact that I hid the x-axis in the first plot?It is indeed because the axis is hidden that the plot sizes become different. I don't have a good explanation for this..To be honest, I have had so much trouble with Qt layouts that I am considering writing my own layout class (but this would be a lot of work).
--
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/CACZXET_dHVTpu1C6RmbfuUNnGDfd%3D9XDXAYCyzAfSt4Z2vu0eQ%40mail.gmail.com.