How to configure a colormap using PyPlot

I see. I found a way to do this from this page of the manual I followed this solution:


using PyPlot

using PyCall

cm=get_cmap(:tab20);

cycler = pyimport("cycler")
PyPlot.rc("axes",prop_cycle=cycler.cycler(color=[cm(t/19) for t in 0:19]))


fig, ax = subplots()

x  = 1:0.1:10
y = exp.(x/π)

for i=1:20
    ax.plot(x/π,i*y, "-o")
end

which gives the plot you have shown above! Probably there’s a nicer way to extract the tab20 cycler!?

3 Likes