I'm creating a plot with multiple AxisItems, that get resized occasionally, 
but I'm trying to preserve the value of the original width in the 
AxisItem.preferredWidth() property (or AxisItem.minimumWidth() 

Setting the value seems to have no effect.  The following assert code will 
fail.  Any help would be appreciated.

import pyqtgraph as pg
import sys
from pyqtgraph.Qt import QtGui, QtCore


class plotWidget(pg.GraphicsView):

    def __init__(self):
        super().__init__()
        self.layout = pg.GraphicsLayout()
        self.setCentralWidget(self.layout)

        self.main_plot = pg.PlotItem()
        ax = self.main_plot.getAxis('left')
        new_min_width = 100
        ax.setMinimumWidth(new_min_width)
        self.layout.addItem(self.main_plot)
        # assert test will fail
        assert ax.minimumWidth() == new_min_width



if __name__ == '__main__':
    pg.mkQApp()
    win = plotWidget()

    win.show()
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
        QtGui.QApplication.instance().exec_()

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/9e94eed1-3a93-4acf-b5a7-4656e3779aa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to