Commit f1fe163a authored by Philipp Arras's avatar Philipp Arras
Browse files

Add the possibility to set aspect to auto in imshows

Espectially useful if the volume in the two directions of a two-dim RGSpace
differs a lot. Then one can produce a square plot with aspect='auto'
parent 03086a06
......@@ -236,6 +236,8 @@ def _plot2D(f, ax, **kwargs):
foo = kwargs.pop("norm", None)
norm = {} if foo is None else {'norm': foo}
aspect = kwargs.pop("aspect", None)
aspect = {} if foo is None else {'aspect': foo}
ax.set_title(kwargs.pop("title", ""))
ax.set_xlabel(kwargs.pop("xlabel", ""))
......@@ -249,7 +251,7 @@ def _plot2D(f, ax, **kwargs):
im = ax.imshow(
f.to_global_data().T, extent=[0, nx*dx, 0, ny*dy],
vmin=kwargs.get("zmin"), vmax=kwargs.get("zmax"),
cmap=cmap, origin="lower", **norm)
cmap=cmap, origin="lower", **norm, **aspect)
plt.colorbar(im)
_limit_xy(**kwargs)
return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment