Is there an easy way to make different axes scale logarithmically? I am using the Matplotlib2DGridContourViewer
and I managed to make the plotted data scale logarithmically using fipy.Viewer(vars=somevariable, log=True)
but I couldn't find anything regarding the axes scaling. In my case I just need the y axis logarithmic.
Also I have another question about the aspect ratio of the viewer. In the documentation of Matplotlib2DGridContourViewer
there is a property called figaspect:
figaspect (float, optional) – desired aspect ratio of figure. If a number, use that aspect ratio. If auto, the aspect ratio will be determined from the vars’s mesh.
I work in Jupyter Notebook and if I set a desired number as aspect ratio e.g. 0.5 it doesn't change the ratio of the lengths of the axes, but rather the aspect ratio of the whole viewer/figure area which means the data won't be more readable, just the viewer area gets squeezed with the plot aspect ratio unchanged. The reason for me wanting to change the axes length ratio is that I have a 2D mesh with 1000x1000 cells and for some reason the default aspect ratio is not determined by that (1:1), but rather from the set maximum coordinates for mesh.x
and mesh.y
. This way if I want to examine a 1:100 mesh I get a basically unreadable, very long plot. (I understand why it is implemented this way but I'm using the 2D mesh for plotting time dependency on a 1D mesh so the time and space coordinates are not even close.)
I guess my question is that is there any way tom make figaspect work the way I want, or is there any other relatively easy way to be able to set the ratio of axes legths? If I could tie the aspect ratio to the number of mesh cells that would also be acceptable.