Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Translate the entire conversation x

How to fill area between four functions?

Cornel
19-Tanzanite

How to fill area between four functions?

Hello,

How to fill the below area enclosed between y1(x), y2(x), y3(x), and y4(x), like below with purple?

Cornel_1-1742544907223.png

 

 

 

Cornel_1-1742544236861.png

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Cornel)


@Cornel wrote:

Hello,

How to fill the below area enclosed between y1(x), y2(x), y3(x), and y4(x), like below with purple?


What you show is NOT the area enclosed by the graphs of these four functions but just the area between y1(x) and y2(x) in the the range 0<x<2.

I consider your way to plot the two orange vertical bars by defining two separate functions y3 and y4 to be very inefficient and uncomfortable. If you would decide to change your range x which you used for plotting, you would have to change these functions as well!!

 

From what I remember you asked very similar questions already in the past and where given working solutions there.

@ttokoro  suggested using the bar plot feature, sometimes with the trick of plotting a graph in background color white to hide unwanted portions.
I provided a simple "Fill" function and LucMeekes offered an Express version of it.
In another thread I showed how to use a simple part of Prof. Birkeland's fantastic work to hatch fill irregular shapes.

All solutions given there in the past could be used with success for your 'new' problem as well, why didn't you gave it a try?

Solved: Re: How to fill the area under the curve with colo... - PTC Community

Solved: Re: How to fill a quadrilateral with color ? - PTC Community

 

Here your new problem solved using the "Fill" function - no need to define extra functions y3 and y4

Werner_E_0-1742572027403.png

 

And here is a variant that takes your thread title verbatim

Werner_E_2-1742572675593.png

 

 

View solution in original post

2 REPLIES 2
ttokoro
21-Topaz I
(To:Cornel)

Add same function but bar type before line type.

 

image.png

Werner_E
25-Diamond I
(To:Cornel)


@Cornel wrote:

Hello,

How to fill the below area enclosed between y1(x), y2(x), y3(x), and y4(x), like below with purple?


What you show is NOT the area enclosed by the graphs of these four functions but just the area between y1(x) and y2(x) in the the range 0<x<2.

I consider your way to plot the two orange vertical bars by defining two separate functions y3 and y4 to be very inefficient and uncomfortable. If you would decide to change your range x which you used for plotting, you would have to change these functions as well!!

 

From what I remember you asked very similar questions already in the past and where given working solutions there.

@ttokoro  suggested using the bar plot feature, sometimes with the trick of plotting a graph in background color white to hide unwanted portions.
I provided a simple "Fill" function and LucMeekes offered an Express version of it.
In another thread I showed how to use a simple part of Prof. Birkeland's fantastic work to hatch fill irregular shapes.

All solutions given there in the past could be used with success for your 'new' problem as well, why didn't you gave it a try?

Solved: Re: How to fill the area under the curve with colo... - PTC Community

Solved: Re: How to fill a quadrilateral with color ? - PTC Community

 

Here your new problem solved using the "Fill" function - no need to define extra functions y3 and y4

Werner_E_0-1742572027403.png

 

And here is a variant that takes your thread title verbatim

Werner_E_2-1742572675593.png

 

 

Announcements

Top Tags