help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Making a 3D graph with highlighted area


From: Damian Harty
Subject: RE: Making a 3D graph with highlighted area
Date: Fri, 25 Apr 2014 10:19:09 +0000

Ø  I’m trying to make a 3D graph of y=1+x^3, highlighting the

      area under the function curve where x is between 1 and 2.

 

      Is this possible?

 

This is a pretty interesting question. I can reproduce the surface from the example but I think what you are interested in is effectively a bifurcated surface. I can imagine making “cliff sides” to the surface:

 

x=[-5 -4 -3 -2 -1 0 1 2           2.99    3 4       4.01       5];

y=1.+x.^3

z=[-2.01 -2 -1 0 1 2 2.01]

x=x(:)

y=y(:)

z=repmat(z,size(x))

x=repmat(x,[1,7])

y=repmat(y,[1,7]);

y(10:11,1)=0

surf(x,z,y)

 

 

But where I struggle is to add the vertical sides, like this:

 

 

..since this looks like a bifurcated (branched) surface and I don’t think surf handles that. Although maybe it just needs a bit more imagination and the same sort of non-linear spacing of data in the other directions, too?

 

Right, tea break’s over. Back on your heads.

 

Damian

 

CONFIDENTIAL: The information contained in this email communication is confidential information intended only for the use of the addressee. Unauthorized use, disclosure or copying of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by return email and destroy all copies of this communication, including all attachments.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]