xarray.plot.line allows you to draw 2d graphs from your x-array. However the lines have a specific colormap which i don't know how to change.
I want to create the plot with a custom ListedColormap instead of the default one.
Example
I don't want the lines to be blue, orange and green
data = xr.DataArray(np.random.randn(2, 3),dims=('x', 'y'),coords={'x': [10, 20]})
>
<xarray.DataArray (x: 2, y: 3)>
array([[ 1.44058444, 0.41396068, 0.08280716],
[ 1.0605549 , -0.97921245, -0.22373267]])
Coordinates:
* x (x) int64 10 20
Dimensions without coordinates: y
>
data.plot.line(x="x")
since xarray.plot.line doens't take a "cmap" argument I don't know how to change the colors.
Thanks for any help!
ax
has been created. Either way, you need a list of colors, not a colormap. – JohanC