I’d like to employ the reverse Spectral colormap
,
https://matplotlib.org/examples/color/colormaps_reference.html
for a lineplot.
This works fine with a hex bin plot::
color_map = plt.cm.Spectral_r
image = plt.hexbin(x,y,cmap=color_map)
but when I do
ax1.plot(x,y, cmp=color_map)
this gives me::
AttributeError: Unknown property cmap
Note, I just want to set the colormap
and let matplotliob
do the rest; i.e. I don't want to have a color=' argument
in the .plot command.
ax.plot(x,y, cmap=color_map)
should be.plot
does not have acmap
argument; most certainly because it is not clear what quantity should be colormapped in a line plot. If you can tell what the desired output should be, there might be a goodalternative. – Elswickcmap
argument. – Elswick