I have a contour plot for which I have selected a finite set of contours. However, the contours overlap in some places and I would like to reverse the order in which they are drawn.
In other words, the last contour (with the largest function value) is currently drawn on bottom, but I would like this contour to be on top. It is confusing for the contour with the largest value to be drawn as if it is beneath the others.
I have struggled to come up with a simple Minimal Working Example which includes contours which actually overlap, so here is my current MWE:
list = {0.25, 0.3, 0.5, 0.7, 0.8}; t = 0.01;
gray = 0.8; styles = {{GrayLevel[gray], Thickness[t]}, {GrayLevel[3/4 gray],Thickness[t]}, {GrayLevel[2/4 gray], Thickness[t]}, {GrayLevel[1/4 gray], Thickness[t]}, {GrayLevel[0], Thickness[t]}};
ContourPlot[Sqrt[x^2 + y^2], {x, -1, 1}, {y, -1, 1}, Contours -> list, ContourStyle -> styles] /. _Polygon -> Sequence[]
The only "problem" with this MWE is I couldn't devise a "simple" function for which the contours overlapped.
However, when I perform this same code for my real (more complex problem) the 100% black line you see in the MWE would be drawn as if on the bottom, and the smaller value (gray) contours are drawn on top.
I have tried to simply apply
list=Reverse[list];
after defining "list" before ContourPlot, but this does not correct the issue.
What can I do to fix this problem?
Lastly, here is an example image from one of my plots that illustrates the gray line (with smaller value) drawn atop the 100% black line (with larger value)
ContourPlot[-Sqrt[...], ..., Contours -> -list]
. $\endgroup$