Replies: 1 comment
-
Hi, dfs.plot(add_colorbar=False,) should do it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to plot a dfsu file using mikeio. I am getting a colorbar in my plot. My target is to create a colorbar manually to control the visible element. Is it possible to remove the existing colorbar and add a new colorbar with my own limit?
I am not sure if the colorbar is related to matplotlib. If I am trying to add any standalone colorbar I am having two bars in the plot and without using matplotlib still I am getting a colorbar.
import mikeio
import matplotlib.pyplot as plt
dfs =mikeio.read(r"C:\Users\FFWS\Desktop\Map_Day01.dfsu")["Maximum water depth"]
dfs.plot()
if I add these few lines I am getting double colorbars
fig, ax = plt.subplots(1,1, figsize=(5,5))
fig.colorbar(mpl.cm.ScalarMappable(norm=mpl.colors.Normalize(0, 1), cmap='Blues'), ax=ax, orientation='vertical', label='a colorbar label')
dfs.plot(ax)
Beta Was this translation helpful? Give feedback.
All reactions