2
$\begingroup$

I am plotting the equation

4 Sqrt[3] x^7 + x^6 (4 - 3 y^2) + 2 Sqrt[3] x^5 (-70 + 9 y^2) + 
  4 Sqrt[3] x^3 (-513 - 19 y^2 + 6 y^4) + 
  2 Sqrt[3] x (-170 - 1263 y^2 + 68 y^4 + 5 y^6) == 
 9 x^4 (156 - 13 y^2 + y^4) + (3 + y^2) (-388 + 963 y^2 - 82 y^4 + 
     3 y^6) + x^2 (3860 + 2013 y^2 - 186 y^4 + 9 y^6)

using ContourPlot. This is the plot I got

enter image description here

However in a published paper, the author got

enter image description here

Where do the two lines at the right come from in my plot.

$\endgroup$

closed as unclear what you're asking by corey979, Feyre, Simon Woods, MarcoB, gpap Nov 21 '16 at 4:06

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ With ContourPlot you can wite: ContourPlot[f==g,{x,xmin,xmax},{y,ymin,ymax}] (see: reference.wolfram.com/language/ref/ContourPlot.html ) so maybe the author used a different value for g. $\endgroup$ – mattiav27 Nov 20 '16 at 9:03
  • $\begingroup$ Are you saying that you do not trust the result you got? If yes, have you tried plotting this in any other way to verify it? Make a Plot3D. Or plot a section at x==9. There are many ways. $\endgroup$ – Szabolcs Nov 20 '16 at 9:24
  • $\begingroup$ @Szabolcs, I did make Plot3D but I am not sure whether the graph matches mine or the author's. $\endgroup$ – MrDi Nov 20 '16 at 9:30
  • $\begingroup$ If you plot the section I suggested, it will be clear that the contour plot you get is correct. $\endgroup$ – Szabolcs Nov 20 '16 at 9:58
  • 5
    $\begingroup$ I don't think this is a well-posed question. The OP asks about why some author, in some paper, using some method achieved his/her result. How could we know what the author had in mind? $\endgroup$ – corey979 Nov 20 '16 at 10:25
4
$\begingroup$
eqn = 4 Sqrt[3] x^7 + x^6 (4 - 3 y^2) + 2 Sqrt[3] x^5 (-70 + 9 y^2) + 
    4 Sqrt[3] x^3 (-513 - 19 y^2 + 6 y^4) + 
    2 Sqrt[3] x (-170 - 1263 y^2 + 68 y^4 + 5 y^6) == 
   9 x^4 (156 - 13 y^2 + y^4) + (3 + y^2) (-388 + 963 y^2 - 82 y^4 + 3 y^6) + 
    x^2 (3860 + 2013 y^2 - 186 y^4 + 9 y^6);

Solving for y

solns = Solve[eqn, y, Reals] // Normal;

Length[solns]

(*  6  *)

The solution has six segments (three mirrored pairs)

Plot[Evaluate[y /. solns], {x, -9, 9},
 PlotRange -> {{-9, 9}, {-9, 9}},
 Frame -> True,
 AspectRatio -> 1,
 PlotLegends -> Automatic]

enter image description here

You wish to delete the last two solutions.

EDIT: Added Filling

Plot[Evaluate[y /. solns[[1 ;; 4]]], {x, -9, 9},
 PlotRange -> {{-9, 9}, {-9, 9}},
 PlotStyle -> Blue,
 Frame -> True,
 AspectRatio -> 1, BaseStyle -> {FontSize -> 16, FontWeight -> Bold},
 Filling -> 1 -> {2}]

enter image description here

$\endgroup$
  • $\begingroup$ You forgot to fill in the closed curved in the middle :P $\endgroup$ – anderstood Nov 20 '16 at 18:07
  • $\begingroup$ @anderstood - added Filling $\endgroup$ – Bob Hanlon Nov 20 '16 at 18:26
  • $\begingroup$ a bit aside i suppose but that filled region is not a solution, so why should it be filled? $\endgroup$ – george2079 Nov 20 '16 at 19:39
  • $\begingroup$ @george2079 - only because the OP requested reproducing a given plot $\endgroup$ – Bob Hanlon Nov 20 '16 at 19:43
3
$\begingroup$

From looking at the two intersecting surfaces in 3D, I conclude that the lines you want to eliminate from your contour plot belong there.

Plot3D[
  {4 Sqrt[3] x^7 + x^6 (4 - 3 y^2) + 
     2 Sqrt[3] x^5 (-70 + 9 y^2) + 
     4 Sqrt[3] x^3 (-513 - 19 y^2 + 6 y^4) + 
     2 Sqrt[3] x (-170 - 1263 y^2 + 68 y^4 + 5 y^6), 
   9 x^4 (156 - 13 y^2 + y^4) + 
     (3 + y^2) (-388 + 963 y^2 - 82 y^4 + 3 y^6) + 
     x^2 (3860 + 2013 y^2 - 186 y^4 + 9 y^6)},
  {x, -5, 10}, {y, -10, 10},
  Boxed -> False,
  Axes -> None,
  SphericalRegion -> True,
  ClippingStyle -> None,
  PlotPoints -> 100,
  Lighting -> "Neutral",
  ImageSize -> 450]

plot3D

Presuming you agree to keep the lines, you can improve the look of your contour plot by giving a few options:

ContourPlot[
  4 Sqrt[3] x^7 + x^6 (4 - 3 y^2) + 2 Sqrt[3] x^5 (-70 + 9 y^2) + 
    4 Sqrt[3] x^3 (-513 - 19 y^2 + 6 y^4) + 
    2 Sqrt[3] x (-170 - 1263 y^2 + 68 y^4 + 5 y^6) == 
  9 x^4 (156 - 13 y^2 + y^4) + 
    (3 + y^2) (-388 + 963 y^2 - 82 y^4 + 3 y^6) + 
    x^2 (3860 + 2013 y^2 - 186 y^4 + 9 y^6),
 {x, -10, 10}, {y, -10, 10},
 PlotPoints -> 50,
 Axes -> True,
 AxesStyle -> Dotted]

plot

The extra plot points are needed to properly show the two cusps at x = 5.53423, y = ±5.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.