How to change colors in "plot_array"? #1525
Answered
by
wpbonelli
wsc1008-cugb
asked this question in
Q&A
-
When I change the color in plot_array(),the result of corresponding color is not generated. The result shows that only the edge color was changed, instead of the facecolor. |
Beta Was this translation helpful? Give feedback.
Answered by
wpbonelli
Aug 31, 2022
Replies: 1 comment 1 reply
-
Hi @wsc1008-cugb, when plotting arrays, the color at any point is a function of the array's value there. This is achieved with colormaps. You can use mx = flopy.plot.PlotCrossSection(ax=ax, model=swt, link={'row': 0})
conduct1 = mx.plot_array(hk11, masked_values=[hk2, hk3], cmap="plasma", alpha=0.75) You'll probably want a sequential colormap for a smooth gradient. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jlarsen-usgs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @wsc1008-cugb, when plotting arrays, the color at any point is a function of the array's value there. This is achieved with colormaps. You can use
cmap
to override the default colormap, which isviridis
. For example:You'll probably want a sequential colormap for a smooth gradient.