Items tagged with filled filled Tagged Items Feed

Good day,

I have plotted a family of lines in one graph, and now I want to shade an area between two horizontal (parallel) lines, for example 2 and 5.
So what I did was to use the command 'filled'. First I shaded the area in vertical direction from 0 to 2 white. After that I filled the area in vertical direction from 0 to 5 for example blue.
This results in a shaded area between 2 and 5 in the color blue, what I like to have.

Question: Is there a way (a command) to fill an area between two horizontal lines more easily? So that I shade it between 2 and 5 in just one commandline. Now I first make a part white, and then the next 'layer' behind is in the color I'd like to have.

Another thing is that when I shade an area in the color white, my gridlines disappear! Is there a way to avoid this?

I have found information about shading area between two intersecting lines (can be done relatively easy), but between two horizontal (parallel) lines I still can't find a simpler way to do it.

Somebody got a suggestion?

Greetings,
Frank

 

I can't solve probably very easy problem. How to plot a filled semicircle which is rotated across one axis by an angle alpha? I came to the solution which I don't consider as the best one (since e.g. it will not work for alpha=Pi/2*(odd integer)) and I believe someone of you will show me a better approach. Thank you in advance.

My solution:

alpha := (1/6)*Pi:
plot3d([x, y, y*tan(alpha)], x = -1 .. 1, y = 0 .. sqrt(1-x^2)*cos(alpha), axes = normal, labels = ["x", "y", "z"...

Suppose that I wanted to produce a 2D plot which was coloured in the region between two functions.

I mean not just between two curves, but between two functions. I would like to make the curves appear as smooth as Maple knows how, but without getting any jaggedness due to using a high grid in an implicitpot.

Consider this example. These two curves are displayed as being quite smooth (using adaptive plotting or whatever `plot` knows to use). How best can the regions between these two curves be filled, without having to recourse perhaps to a rough implicit plot?

plot([x^2-1, -x-1], x=-1.5..1.5, y=-1.5..1.5, color=black);



A simple trick with a product provides a defined implicit region that `implicitplot` can handle. But there can be small gaps, or irregularities, because the formulas for the curves are being solved in a complicated way and no longer being used as mere functions.

plots:-implicitplot( (y - (x^2-1))*(y - (-x-1)),
                     x=-1.5..1.5, y=-1.5..1.5,
                     filledregions=true, gridrefine=4,
                     coloring=[COLOUR(RGB,.8,.8,.9),"white"],
                     axes=boxed, labels=["x","y"],
                     view=[-1.5..1.5,-1.5..1.5] );



Another technique is to overlay two simpler implicit plots, colouring and layering them carefully so as to give the impression that only the inner regions had been coloured. The problem here is that the intersections all have to be computed and the problem split up piecemeal (which I did not do) so that the layered colouring is adjusted to whichever curve lies on top. Without that care, then something like this happens, with odd subregions appearing uncoloured.

plots:-display(
   plots:-implicitplot( x^2-1 >= y, x=-1.5..1.5, y=-1.5..1.5,
                        filledregions=true, gridrefine=4,
                        coloring=["white","white"] ),
   plots:-implicitplot( -x-1 >= y, x=-1.5..1.5, y=-1.5..1.5,
                        filledregions=true, gridrefine=2,
                        coloring=[COLOUR(RGB,.8,.8,.9),"white"] ),
               axes=boxed, labels=["x","y"], view=[-1.5..1.5,-1.5..1.5]);



Did I miss something obvious? Is there some other calling sequence or command that makes this much easier (and smoother, by default)?

I am trying to draw a triangle with black lines and fill it in gray. Based on the maple help code i am trying this code:

draw(T, thickness = 3, filled = [color = "Blue"])

It does draw the triangle T with the right thickness, but the triangle isn't filled. Any thoughts?

 

help appreciated

 

Pieter

 

Christopher2222's recent post reminded me of a new plot feature that inadvertently (and through my own fault) got left out of the new-features help pages. The 'filled' option now takes a true/false value or a list of suboptions. The suboptions apply to the polygons that make up the filled region under the curve.

plot(x^2, x=0..1, color="NavyBlue", thickness=3, filled=[color="Blue", transparency=0.7]);

Page 1 of 1