Commit f2ec76f0 authored by Andrija Kostic's avatar Andrija Kostic Committed by Philipp Arras
Browse files

A quick fix to make the colorbars nicer and adapt their size to the 2D plots canvas

parent 952f9dd9
Pipeline #105715 passed with stages
in 35 minutes and 30 seconds
......@@ -370,6 +370,7 @@ def _plot1D(f, ax, **kwargs):
def _plot2D(f, ax, **kwargs):
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
dom = f.domain
......@@ -425,7 +426,8 @@ def _plot2D(f, ax, **kwargs):
f.val.T, extent=[0, nx*dx, 0, ny*dy],
vmin=kwargs.get("vmin"), vmax=kwargs.get("vmax"),
cmap=cmap, origin="lower", **norm, **aspect)
cax = make_axes_locatable(ax).append_axes("right", size="5%", pad=0.05)
plt.colorbar(im, cax=cax)
elif isinstance(dom, (HPSpace, GLSpace)):
Supports Markdown
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