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
    $\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 '18 at 8:32
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$
  • $\begingroup$ Thank you so much, it's great! Is it possible to change the color of the surface, for example with a light blue color? Thanks again! $\endgroup$ – TeM Feb 14 '18 at 8:53
  • $\begingroup$ @TeM, please see the new version. $\endgroup$ – kglr Feb 14 '18 at 8:57
  • $\begingroup$ Perfect, thanks! $\endgroup$ – TeM Feb 14 '18 at 9:11
  • $\begingroup$ @TeM, my pleasure. Thank you for the accept. $\endgroup$ – kglr Feb 14 '18 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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