Current list of colorschemes in Plots.jl

Thanks, piever: first trick (line_z) helps!

Second answer – maybe I was not clear… What I meant is: consider a surface plot of the Rosenbrock function:

function rosenbrock(x,y)
return (1-x)^2 + 100*(y-x^2)^2
end

x = linspace(-2,2)
y = linspace(-1,3)

plot(x,y,rosenbrock,st=:surface)

a: I want to add contour lines in the plot (that used to be possible, but I cannot find the keyword now (i.e., instead of “:surface”)

b: Often, the surface + contour plots don’t show off so well – typically when the surface hides the contours. So – how can I offset the z-position of the contours from z=0 to, say, z = -500?

“Concerning layout, this tutorial (3) may be helpful.”

My question was related to this tutorial, I guess… which says:

"The @layout macro is the easiest way to define complex layouts, using Julia’s multidimensional Array construction as the basis for a custom layout syntax. Precise sizing can be acheived with curly brackets, otherwise the free space is equally split between the plot areas of subplots.

l = @layout [ a{0.3w} [grid(3,3)
b{0.2h} ]]
plot(
rand(10,11),
layout = l, legend = false, seriestype = [:bar :scatter :path],
title = [“($i)” for j = 1:1, i=1:11], titleloc = :right, titlefont = font(8)
)"

However, the tutorial does not state the meaning of “a” and “b” in the constructs " a{0.3w}" and “b{0.2h}”. My question is on what these mean. [I can guess, but perhaps it should not be necessary to guess??]

Btw: how can I define my own “color gradient”/“color library”? For some plots, I’d like to use the color scheme of my employer…

cgrad(vector_of_colors). Isn’t that in the docs?

Possibly in the docs. I find the docs quite useful, but I don’t find them particularly systematic and easy to get around in.

There’s a suggestion for a new structure here: https://github.com/JuliaPlots/PlotDocs.jl/issues/71
You’d be very welcome to add feedback and ideas.

1 Like

OK – I’ll take a look at it. Personally, I like to print a pdf manual over using a web based tool; to me, that helps in learning. But others may feel differently. I will look over my private notes on Matplotlib/PyPlot from when I focused on Python, and see how my experience from that period can be useful in the Plots documentation structure. It will take a couple of weeks to summarize my thoughts, though.

Great! Even if we do act on the issue on the meantime your thoughts would be very welcome.

Hi @mkborregaard, great guide!

For the colormap :jet there isn’t a reversed version :jet_r. Please advise?

Since you are asking me to advise, I will :-). Don’t use jet! It doesn’t have good properties for scientific visualization. Use a colorscheme that has.
But to answer your question, you do cgrad(:jet, reverse = true) today. The docs are massively improved today, btw ColorSchemes · Plots

5 Likes

Thank you! Such a fast reply, wow.

Haha, well I should’ve been more polite and addressed it to everyone/anyone who knows.

Mind you (and everyone), taking @mkborregaard’s advice and digging into the documentation, when plotting contours using seriescolor it has to be

seriescolor = cgrad(:jet, rev = true)

with rev = true instead of reverse = true which doesn’t work.

Thanks for your help @mkborregaard!

2 Likes