Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

parametric plot and filling

948 views
Skip to first unread message

Francisco Gutierrez

unread,
Aug 20, 2013, 7:36:21 AM8/20/13
to

Dear group:

DoesParametricPlot admit the Filling option? Seems it not? How then to perform it?
Lokk at the following simple example:

ParametricPlot[{{2 t,-t^2},{6+ 2 t,-t^2}}, {t,-2,2},Axes->{True,False}, Ticks->None, PlotStyle->{{Thick,Cyan},{Thick,Green}}]



The if I introduce the Filling command inside PlotStyle nothing happens, and outside it produces an error. Any ideas?
francisco

Bob Hanlon

unread,
Aug 21, 2013, 1:57:21 AM8/21/13
to

I would try to convert it to a standard plot.


ParametricPlot[
{{2 t, -t^2}, {6 + 2 t, -t^2}},
{t, -2, 2},
Axes -> {True, False},
Ticks -> None,
PlotStyle -> {{Thick, Cyan}, {Thick, Green}}]


Plot[
Evaluate[y /. {
Solve[Thread[
{x, y} == {2 t, -t^2}], {y, t}],
Solve[Thread[
{x, y} == {6 + 2 t, -t^2}], {y, t}]}],
{x, -4, 10},
Axes -> {True, False},
Ticks -> None,
PlotStyle -> {{Thick, Cyan}, {Thick, Green}},
PlotRange -> {-4, 0},
AspectRatio -> 0.285714,
Filling -> -4]



Bob Hanlon

Roland Franzius

unread,
Aug 22, 2013, 12:34:32 AM8/22/13
to
Produce lists of the parametric plots and use ListLinePlot which is the
most universal primitive with respect ot options

lists = Table[{{2 t, -t^2}, {6 + 2 t, -t^2}}, {t, -2, 2, 0.02}];

ListLinePlot[Transpose[lists], Filling -> Axis]

Transpose is needed to re-index the lists of pairs of points into two
lists of points.

--

Roland Franzius

Roland Franzius

unread,
Aug 22, 2013, 12:44:57 AM8/22/13
to
Am 20.08.2013 13:36, schrieb Francisco Gutierrez:

Murray Eisenberg

unread,
Aug 22, 2013, 12:45:17 AM8/22/13
to
Right, Filling is not a permissible option to ParametricPlot.

But suppose Wolfram wanted to make it an option. What, exactly, do you
propose it should do. For example, in what way would you expect a
Filling option to work with each of the following?

ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 2 Pi}]
ParametricPlot[{s, t}, {s, -2, 2}, {t, 1, 3}]
ParametricPlot[{t, 2}, {x, -5, 5}]
ParametricPlot[{t Sin[t], t Cos[t]}, {t, 0, 6 Pi}]


On Aug 20, 2013, at 7:36 AM, Francisco Gutierrez
<fgutie...@yahoo.com> wrote:

>
> DoesParametricPlot admit the Filling option? Seems it not? How then to
perform it?
> Lokk at the following simple example:
>
> ParametricPlot[{{2 t,-t^2},{6+ 2 t,-t^2}},
{t,-2,2},Axes->{True,False}, Ticks->None,
PlotStyle->{{Thick,Cyan},{Thick,Green}}]
>
> The if I introduce the Filling command inside PlotStyle nothing
happens, and outside it produces an error. Any ideas?
> francisco

---
Murray Eisenberg
mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower
University of Massachusetts
710 North Pleasant Street
Amherst, MA 01003-9305






Bob Hanlon

unread,
Aug 22, 2013, 12:47:57 AM8/22/13
to

I also noticed that Solve does not need the Thread. This also works:

Plot[Evaluate[y /. {
Solve[{x, y} == {2 t, -t^2}, {y, t}],
Solve[{x, y} == {6 + 2 t, -t^2}, {y, t}]}],
{x, -4, 10},
Axes -> {True, False},
Ticks -> None,
PlotStyle ->
{{Thick, Cyan}, {Thick, Green}},
PlotRange -> {-4, 0},
AspectRatio -> 0.285714,
Filling -> -4]



Bob Hanlon




On Wed, Aug 21, 2013 at 1:58 AM, Bob Hanlon <hanlo...@gmail.com> wrote:

>
> I would try to convert it to a standard plot.
>
>
> ParametricPlot[
> {{2 t, -t^2}, {6 + 2 t, -t^2}},
> {t, -2, 2},
> Axes -> {True, False},
> Ticks -> None,
> PlotStyle -> {{Thick, Cyan}, {Thick, Green}}]
>
>
> Plot[
> Evaluate[y /. {
> Solve[Thread[
> {x, y} == {2 t, -t^2}], {y, t}],
> Solve[Thread[
> {x, y} == {6 + 2 t, -t^2}], {y, t}]}],
> {x, -4, 10},
> Axes -> {True, False},
> Ticks -> None,
> PlotStyle -> {{Thick, Cyan}, {Thick, Green}},
> PlotRange -> {-4, 0},
> AspectRatio -> 0.285714,
> Filling -> -4]
>
>
>
> Bob Hanlon
>
>
>
>
> On Tue, Aug 20, 2013 at 7:36 AM, Francisco Gutierrez <
> fgutie...@yahoo.com
> > wrote:
>
> >
> > Dear group:

W Craig Carter

unread,
Aug 23, 2013, 3:49:52 AM8/23/13
to
Here is another way to get filling:

OrbitOrbit[ r_, t_, n_] := { r Cos[n t ] + Cos[t], r Sin[n t] + Sin[t]}

ParametricPlot[OrbitOrbit[r, t, 6], {t, -Pi, Pi}, {r, .25, .9},
PlotStyle -> {Thick, Red}, Mesh -> False, PlotPoints -> 36,
ColorFunction -> (Hue[#3, 1, 1, 0.25] &)]



W Craig Carter
Professor of Materials Science, MIT



On Aug 22, 13, at 0:51 AM, Murray Eisenberg wrote:

> Right, Filling is not a permissible option to ParametricPlot.
>
> But suppose Wolfram wanted to make it an option. What, exactly, do you
> propose it should do. For example, in what way would you expect a
> Filling option to work with each of the following?
>
> ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 2 Pi}]
> ParametricPlot[{s, t}, {s, -2, 2}, {t, 1, 3}]
> ParametricPlot[{t, 2}, {x, -5, 5}]
> ParametricPlot[{t Sin[t], t Cos[t]}, {t, 0, 6 Pi}]
>
>
> On Aug 20, 2013, at 7:36 AM, Francisco Gutierrez
> <fgutie...@yahoo.com> wrote:
>
>>
>> DoesParametricPlot admit the Filling option? Seems it not? How then to
> perform it?
>> Lokk at the following simple example:
>>
>> ParametricPlot[{{2 t,-t^2},{6+ 2 t,-t^2}},
> {t,-2,2},Axes->{True,False}, Ticks->None,
> PlotStyle->{{Thick,Cyan},{Thick,Green}}]
>>
>> The if I introduce the Filling command inside PlotStyle nothing
> happens, and outside it produces an error. Any ideas?
>> francisco
>

Murray Eisenberg

unread,
Aug 23, 2013, 3:50:13 AM8/23/13
to
Nice! But that doesn't answer my question as to what, _in general_ an option of Filling should do with arbitrary ParametricPlot output.

W Craig Carter

unread,
Aug 23, 2013, 4:56:07 AM8/23/13
to
Hello Murray---I agree. But, a perhaps a trick might be in finding a
parameterization that does the particular filling that the user has in
mind? My first guess is that one would want ParametricPlot only to be
able to fill when two curves are available, and then fill according to
the positions corresponding to the same parameters.

(*My students always like this example... If you try a Manipulate on
this example---it gives puzzling results that I haven't tracked down
yet; but are probably associated with the fast rendering not getting
updated in the manipulate when a Mesh is rendered. *)

Cheers, Craig

W Craig Carter
Professor of Materials Science, MIT



Helen Read

unread,
Aug 23, 2013, 5:28:11 AM8/23/13
to
Use a second parameter. For example,

ParametricPlot[{{2 t, -m t^2}, {6 + 2 t, -m t^2}}, {t, -2, 2}, {m, 0,
1}, Axes -> {True, False}, Ticks -> None, PlotStyle -> Green,
BoundaryStyle -> {Thick, Cyan}, Mesh -> False, Frame -> False]


ParametricPlot[{r Cos[t], r Sin[t]}, {t, 0, 2 \[Pi]}, {r, 3, 4},
Mesh -> False, PlotStyle -> Red, BoundaryStyle -> None,
Axes -> False, Frame -> False]

Helen Read
University of Vermont

Francisco Gutierrez

unread,
Aug 31, 2013, 8:19:00 AM8/31/13
to

Many thanks to Helen Read, Craig Carter, Murray Eisenberg, Roland Franzius, Bob Hanlon, and other group members/gurus for their responses to my query. As always, a nice set of excellent solutions (for example Helen's), which corroborates
how good a resource this group is. By now I think no more answers will come in.

Indeed, as Murray Eisenberg notes, there are situations in which the filling option simply does not make sense. Even then, there are other situations where it does. Suppose you have the following curve:

ParametricPlot[{Cos[x],Sin[x^2]}, {x,0,Pi}]


One could want to highlight the regions in which the curve goes above the x axis. Filling would come in handy there.

Well, once again, thanks!
Francisco

Bob Hanlon

unread,
Sep 1, 2013, 3:16:02 AM9/1/13
to

The approach recommended by Roland Franzius works for your example:


ParametricPlot[{Cos[x], Sin[x^2]},
{x, 0, Pi}]


ListLinePlot[
Table[{Cos[x], Sin[x^2]},
{x, 0, Pi, Pi/64}],
AspectRatio -> 1,
Filling -> {1 -> {0, {White, LightBlue}}}]



Bob Hanlon
0 new messages