|
From: Benjamin R. <ben...@ou...> - 2014-08-25 14:00:55
|
Maciej, When you close a figure, just about everything gets destroyed (this is why you should always savefig() prior to doing a show()). There is a mechanism for "reloading" a plot using python pickles: http://stackoverflow.com/questions/7290370/store-and-reload-matplotlib-pyplot-object As for setting the aspect ratio to 'equal', there is a second optional argument that indicates which thing should get adjusted to achieve an equal aspect. By default, it is 'datalim', I think, which adjusts the limits of the axes. I think if you set it to 'box', it will do what you want (you might need 'box-forced' if you are sharing axes). Fiddle around with these settings to get what you want. http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.set_aspect To have the axes extended on the whole figure area, there are multiple ways to do that. In particular, you can set the margins for the figure: http://matplotlib.org/api/pyplot_api.html?highlight=subplots_adjust#matplotlib.pyplot.subplots_adjust All of this would work just fine with autoscale. I hope that helps! Ben Root On Mon, Aug 25, 2014 at 7:00 AM, Maciej Kurnicki <kur...@gm...> wrote: > I'm using matplotlib for drawing lines, points and circles basically. I > have 2 problems i can't solve by myself and it's hard to solve them not > digging into source i think. > First problem: I got an instance of figure class and i want to preserve > it during closing and reopening the output window. I'm curious what is > happening after clicking on close button on the main widow and is there > any way to reopen previously saved figure, and if yes how to save that > figure for future reopenings. > Second problem: I want to achieve 3 things simultaneously, > a) have the axes extended on the whole figure area > b) unit distance on y axis has to be the same as unit distance on x axis > c) all above has to work well with autoscale(), i want to have a lot of > artists on the axes > The best thing i have is setting aspect as equal and using autoscale, > but it fix axes to be same lenght and i don't want axes to be same > length i want the unit distance to be the same > > Thanks for any help, > Maciek > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |