2
$\begingroup$

Writing:

ParametricPlot[{{x, 0}, {x, 1}}, {x, 0, 1}, Axes -> False]

I get:

enter image description here

while writing:

ParametricPlot[{{x, 0}, {x, 1}}, {x, 0, 1}, Axes -> False, Filling -> {1 -> {2}}]

I get an error instead of:

enter image description here

How can I correct? Thank you!

$\endgroup$
1
  • 1
    $\begingroup$ You could do something along those lines ParametricPlot[{x, y}, {x, 0, 1}, {y, x, x^2}, Axes -> False], in your case {y, 0, 1}. $\endgroup$
    – Kuba
    Feb 14, 2018 at 8:32

1 Answer 1

4
$\begingroup$

Filling is not an option for ParametricPlot. You can use, instead,

ParametricPlot[t {x, 0} + (1 - t) {x, 1}, {x, 0, 1}, {t, 0, 1}, 
 Axes -> False, MeshFunctions -> {#4 &, #4 &}, Mesh -> {{0}, {1}}, 
 MeshStyle -> {Orange, Blue}, BoundaryStyle -> None, PlotStyle -> LightBlue]

enter image description here

Alternatively,

ParametricPlot[{x, y}, {x, 0, 1}, {y, 0, 1}, Axes -> False, 
 MeshFunctions -> {#2 &, #2 &}, Mesh -> {{1}, {0}}, 
 MeshStyle -> {Orange, Blue}, BoundaryStyle -> None,  PlotStyle -> LightBlue]

same picture

$\endgroup$
2
  • $\begingroup$ @TeM, please see the new version. $\endgroup$
    – kglr
    Feb 14, 2018 at 8:57
  • $\begingroup$ @TeM, my pleasure. Thank you for the accept. $\endgroup$
    – kglr
    Feb 14, 2018 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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