I have generated the following contour plot in Mathematica using a (extremely lengthy) function, $f$:

contour plot

I used ImagePadding -> 1, PlotRangePadding -> None to remove the axes labels (so I could add them in LaTeX later), which have the following range: x-axis: 0 to 1, y-axis: 0 to 2$\pi$.

Using the the problem is that I expect the black region to have more information. Using FindMinimum, I have plotted the minimum using a red dot (2 of them can be seen near the y axis since it is a periodic function).

How can I adapt the following ContourPlot functions so that it adds more contours around the black region?

ContourPlot[QCRB[r\[Xi], \[Theta]\[Xi], 0.78, 1 \[Pi], 0.8 \[Pi], 1, 1][[1, 2]], {r\[Xi], 0, 1}, {\[Theta]\[Xi], 0, 2 Pi}, PlotLegends -> Automatic, Contours -> 15, WorkingPrecision -> 10, ImagePadding -> 1, PlotRangePadding -> None, ColorFunction -> "SunsetColors", ContourStyle -> {Thickness[0.003]}, FrameStyle -> Thickness[0.008], FrameTicksStyle -> Thickness[0.008] ] 
  • $\begingroup$ You can use contours with any function value $f=c_i$ with Contours -> Table[c[i],{i,15}] $\endgroup$ – Alex Trounev Dec 13 '18 at 12:24
  • $\begingroup$ Dear Sid, please could you show me how to add the axis labels in Latex, and in what format you export the image from Mathematica ? $\endgroup$ – Simon Dec 13 '18 at 13:20
  • 1
    $\begingroup$ @Simon, export as .pdf, and import into a standalone tikz file. You can then add nodes for the axes labels. This is the best way I've come across doing this. $\endgroup$ – Sid Dec 13 '18 at 13:57
  • $\begingroup$ @AlexTrounev - or more compactly, Contours -> c /@ Range[15] $\endgroup$ – Bob Hanlon Dec 13 '18 at 14:57
  • 1
    $\begingroup$ @Sid use FrameLabel -> {"x", "y"}to add axis names. To save, put the pointer on the image and press the right mouse button. A window will open, choose Save Graphics As, window will open with a choice of 14 formats. $\endgroup$ – Alex Trounev Dec 13 '18 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.