Message Boards Message Boards

0
|
1013 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Show multiple PlotRange in parametric plot

In the notebook, I have two parametric plots for different plotrange in y axes as you can see in the first two plots. Now to combine them in a single plot i tried using Show command. But it shows plotrange for the first plot only. How can I fix it or is there any other way to do this?
Thank You

POSTED BY: Debojyoti Mondal
3 Replies

The function Show is tricky, because it will use the PlotRange of the first plot and ignore the other ranges, unless you give it a value at the end. What plot range do you wish for the combined plot?

Show[
 ParametricPlot[{r^2 + 1, 1/r}, {r, 1, 5}],
 ParametricPlot[{r^2 + 2, 2/r}, {r, 1, 5}],
 PlotRange -> All, AspectRatio -> 1/2]

or, more simply,

ParametricPlot[{{r^2 + 1, 1/r}, {r^2 + 2, 2/r}}, {r, 1, 5},
 PlotRange -> All, AspectRatio -> 1/2]
POSTED BY: Gianluca Gorni

I want use Plotrange in y-axis 0.2 to 0.8 for first plot and 1 to 2 for second plot and show them in single graph.

POSTED BY: Debojyoti Mondal

I don't know of a straightforward way. You either change the ranges of r, or use RegionFunction:

Show[ParametricPlot[{r^2 + 1, 1/r}, {r, 1, 5},
  PlotRange -> {{0, 10}, {0.2, 0.8}},
  RegionFunction -> Function[{x, y}, 0.2 < y < .8]],
 ParametricPlot[{r^2 + 2, 2/r}, {r, 1, 5},
  RegionFunction -> Function[{x, y}, 1 < y < 2]],
 AspectRatio -> 1/2, PlotRange -> {{0, 10}, {0.2, 2}}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract