ebranlard / pyDatView

A crossplatform GUI to plot tabulated data from files (e.g. CSV, Excel, OpenFAST, HAWC2, Flex...), or python pandas dataframes
MIT License
107 stars 41 forks source link

Remember subplot adjustements on redraw #147

Closed ebranlard closed 11 months ago

ebranlard commented 1 year ago

Reproduce:

see also #65

ebranlard commented 1 year ago

Note: the parameters can be obtained as follows:

    params = self.canvas.figure.subplotpars
    paramsD= {}
     for key in ["left", "bottom", "right", "top", "wspace", "hspace"]:
            paramsD[key]=getattr(params, key)
            self.canvas.figure._subplotsPar = paramsD

The are changed dynamically by the SubplotTool of widgets.py.

The subplot tool is launched by NavigationToolBar2.configure_subplots(self, *args) There is a hook, when the subplot window is closed that we can use to setup a trigger, e.g.:

    tool_fig.canvas.mpl_connect("close_event", close_event)
ebranlard commented 11 months ago

Spacings stored in class on draw event, before deleting the figure.