Skip to content

How to change colors in "plot_array"? #1525

Answered by wpbonelli
wsc1008-cugb asked this question in Q&A
Discussion options

You must be logged in to vote

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 is viridis. For example:

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wsc1008-cugb
Comment options

Answer selected by jlarsen-usgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants