How can I resize plot?

40 views
Skip to first unread message

da...@neocopia.com

unread,
Jun 28, 2015, 11:00:20 AM6/28/15
to pyqt...@googlegroups.com
hey,

I have this code:

self._i1 = CandleStickItem(drawCandles=True, drawVolumeBars=False, drawBook=True)
        self._p1 = self.addPlot(name='candles', row=1, col=0, rowspan=9)
        self._p1.addItem(self._i1)
        self._p1.resize(900,900)
        #print self._p1.size().height()
        self._p1.getAxis('bottom').tickStrings = self._x_axis_tick_strings
       
        self._i2 = CandleStickItem(drawCandles=False, drawVolumeBars=True, drawBook=False)
        self._p2 = self.addPlot(name='volumes',row=10, col=0, rowspan=1)
        self._p2.addItem(self._i2)
        self._p2.setXLink(self._p1)
        self._p2.resize(600,500)
        self._p2.getAxis('bottom').tickStrings = self._x_axis_tick_strings

which presents me this:



 I want the first plot to be bigger then the second, but I cant do this..
Both are at the same widget.

Thanks for helping!
Dana
Message has been deleted

da...@neocopia.com

unread,
Jun 29, 2015, 4:48:54 AM6/29/15
to pyqt...@googlegroups.com
hey!!

I actually managed to succeed on my on..
here how it looks like:
 self._i1 = CandleStickItem(drawCandles=
True, drawVolumeBars=False, drawBook=True)
        self._p1 = self.addPlot(name='candles',row=1,col=1)
        self._p1.addItem(self._i1)

        self._p1.getAxis('bottom').tickStrings = self._x_axis_tick_strings

        self._i2 = CandleStickItem(drawCandles=False, drawVolumeBars=True, drawBook=False)
        self._p2 = self.addPlot(name='volumes',row=2,col=1)
        self._p2.addItem(self._i2)
        self._p2.setXLink(self._p1)
        self._p2.setFixedHeight(self.height()/5)

        self._p2.getAxis('bottom').tickStrings = self._x_axis_tick_strings

here is the line that helped me: self._p2.setFixedHeight(self.height()/5)

Hope It'll help someone else :)
 
Reply all
Reply to author
Forward
0 new messages