Group Abstract Group Abstract

Message Boards Message Boards

2
|
7K Views
|
6 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Problem With Parametric Plot

How can I get rid rid of the line from the center of the astroid to one of its cusps?`

ParametricPlot[{0.2178710789897841` - 
   0.9719522806619472` ss Cos[p]^3 + 0.23517815399402978` ss Sin[p]^3,
   0.025022182511575484` - 0.23517815399402978` ss Cos[p]^3 - 
   0.9719522806619472` ss Sin[p]^3}, {p, 0, 2 \[Pi]}, {ss, 0, 
  0.281546015800896`}]

enter image description here

POSTED BY: Frank Kampas
6 Replies

BoundaryStyle -> None appears to be the fastest.

POSTED BY: Frank Kampas

Or

Region[ParametricRegion[a {Cos[p]^3, Sin[p]^3}, {{p, 0, 2 \[Pi]}, {a, 0, 10}}]]

enter image description here

POSTED BY: Shenghui Yang

Yes, I found that out after I made the post. It also removes the outer boundary, so I also have to do another plot which just does the outer boundary.

POSTED BY: Frank Kampas
Posted 5 years ago

Another kind of workaround. Makes the plot appearance more "pale", but it removes the line:

ParametricPlot[a {Cos[p]^3, Sin[p]^3}, {p, 0, 2 \[Pi]}, {a, 0, 1}, Axes -> False, BoundaryStyle -> None]
POSTED BY: Hans Milton

I believe the problem here is that when the angle is held at 0, ParametricPlot draws the offending line segment as part of the boundary.

First, a graph just showing the segment with the angle held at 0.

p = 0;
noAngleDep = 
 ParametricPlot[{0.2178710789897841 - 
    0.9719522806619472 ss Cos[p]^3 + 0.23517815399402978 ss Sin[p]^3, 
   0.025022182511575484 - 0.23517815399402978 ss Cos[p]^3 - 
    0.9719522806619472 ss Sin[p]^3}, {ss, 0, 0.281546015800896}, 
  PlotStyle -> Green ]

Then your code:

angleDep = 
 ParametricPlot[{0.2178710789897841` - 
    0.9719522806619472` ss Cos[p]^3 + 
    0.23517815399402978` ss Sin[p]^3, 
   0.025022182511575484` - 0.23517815399402978` ss Cos[p]^3 - 
    0.9719522806619472` ss Sin[p]^3}, {p, 0, 2 \[Pi]}, {ss, 0, 
   0.281546015800896`}, PlotStyle -> Red]

And one on top of the other:

Show[{angleDep, noAngleDep}]

I believe you can set the color and opacity of the region this way:

angleDep = 
 ParametricPlot[{0.2178710789897841` - 
    0.9719522806619472` ss Cos[p]^3 + 
    0.23517815399402978` ss Sin[p]^3, 
   0.025022182511575484` - 0.23517815399402978` ss Cos[p]^3 - 
    0.9719522806619472` ss Sin[p]^3}, {p, 0, 2 \[Pi]}, {ss, 0, 
   0.281546015800896`}, PlotStyle -> {Red, Opacity[1]}]

and set the color of the "no angle dependence" plot to the same color:

p = 0;
noAngleDep = 
 ParametricPlot[{0.2178710789897841 - 
    0.9719522806619472 ss Cos[p]^3 + 0.23517815399402978 ss Sin[p]^3, 
   0.025022182511575484 - 0.23517815399402978 ss Cos[p]^3 - 
    0.9719522806619472 ss Sin[p]^3}, {ss, 0, 0.281546015800896}, 
  PlotStyle -> Red]

And then just show them together, and you should be set:

Show[{angleDep, noAngleDep}]
POSTED BY: Nathan Shpritz

The problem also occurs for simple arguments:

ParametricPlot[a {Cos[p]^3, Sin[p]^3}, {p, 0, 2 \[Pi]}, {a, 0, 1}, 
 Axes -> False]

enter image description here

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard