Plots.Controur() allows x,y,z to be Vector{Float64}.
AbstractPlotting.Contour() chokes when I swap out the Plots version for the Makie version.

ERROR: There was no `AbstractPlotting.convert_arguments` overload found for
the plot type Combined{AbstractPlotting.contour,Tuple{Array{Float64,1},Array{Float64,1},Array{Float64,1}}}, or its conversion trait AbstractPlotting.SurfaceLike().
The arguments were:
(Array{Float64,1}, Array{Float64,1}, Array{Float64,1})

To fix this, define `AbstractPlotting.convert_arguments(::Combined{AbstractPlotting.contour,Tuple{Array{Float64,1},Array{Float64,1},Array{Float64,1}}}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1})`.

This would just be a matter of adding a convert method for this case. What isn’t clear to me is what format these vectors are in, and therefore what kind of conversion logic to 2D we would need. Is there a standard for this kind of thing?

1 Like

Plots.contour does it, so what do they do?

I don’t know, would be interesting if you could find out

I should have said the Plots backend I was using was plotly. I don’t know if that matters. I started to dig around on github, but that has not been fruitful. I’ll see if I can run it through the debugger and figure out how it converts it to a surface.

At least contourf and contour algorithms in their current state need data on a rectilinear grid, so there must be a fool-proof way to convert vectors into that. I’m just wondering what happens if data is missing, duplicated, non-rectilinear, all those edge cases

The debugger did not help me much.

I think, if I just made my z-vector 2D, it should work. There is really no reason I can’t do that.

The contour interface is a bit finicky.

Struggling to figure out adding a title to it and axis labels. I need to find that example.

You mean in Makie or in Plots now?

In Makie, what is the syntax to add a title to the contour plot if I’m doing a layout?


                contour_labels=true,levels=20,colormap=:lightrainbow, title="Z1")


This is what I had to do.



now I need to figure out xlabel! and ylabel!.

Surely there is an easier way… no?

Excellent! The “end comma” on the kw-argument! That is what was disallowing it.

should have been

contour(blah,blah,blah, axis = (title="blah", xlabel="xblah", ylabel="yblah", ))

Anyone know where the contour line labels are hiding for Makie? contour_labels=true does not seem to work like it does in plots and I don’t see it in the attributes list.

you only need the end comma if you only have one argument, because (a = 3) is not parsed as a namedtuple

1 Like

and we don’t have contour labels implemented currently