# Mathematica Contour Plot Problem [duplicate]

When I type

ContourPlot[x == Sin[6*Pi*y], {x, -1, 1}, {y, -2, 2}]


I get this

Now I'm not a particularly gifted mathematician, but I have a feeling this just might be wrong. How do I get Mathematica to plot it correctly?

## marked as duplicate by Mr.Wizard♦Feb 1 '15 at 1:13

• closely related: 31164 – Kuba Jan 31 '15 at 18:08
• I'm gathering you're new to Mathematica. Is this plot truly what you were seeking? You're plotting a logical (Boolean) function--i.e., one that has output TRUE or FALSE. I suspect you wanted to plot $Sin[6 \pi y]$ or something like that. – David G. Stork Jan 31 '15 at 18:45
• @DavidG.Stork Yes, I wanted to plot $x = Sin [6 \pi y]$, this should have worked in theory though – user85798 Jan 31 '15 at 19:42
• @LTS A much better way is $Plot[Sin[6 \pi y], \{y, -2,2\}]$... You don't have to specify the range of the output; it generalizes to other functions immediately; it is understood by others better, and on and on. Another question to you: Do you really want to be the $.00001\%$ of cases where you plot $x$ as a function of $y$, instead of the standard $y$ versus $x$ used in every textbook and technical presentation? – David G. Stork Jan 31 '15 at 20:02
• @DavidG.Stork No, I want to plot the inverse of $\sin[6\pi x]$. I could write it as an explicit function of x, but that would be rather difficult since it's not a proper function. – user85798 Jan 31 '15 at 20:42

ContourPlot is not as smart as you so you have to give it more PlotPoints to sample domain or use more suited for this job function:

ParametricPlot[{Sin[6*Pi*y], y}, {y, -2, 2}]


• Thank you, I did not know about ParametricPlot. – user85798 Jan 31 '15 at 18:31
ContourPlot[x == Sin[6*Pi*y], {x, -1, 1}, {y, -2, 2}, PlotPoints -> 100]


Just increase MaxRecursion to track the curve correctly

ContourPlot[x == Sin[6*Pi*y], {x, -1, 1}, {y, -2, 2}, MaxRecursion -> 3]


Usually PlotPoints and MaxRecursion options solve almost all resolution problems.