The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Shading area under a graph to represent another variable.
Replies: 2   Last Post: Nov 6, 2013 12:27 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kelly Kearney

Posts: 24
Registered: 4/25/13
Re: Shading area under a graph to represent another variable.
Posted: Nov 6, 2013 12:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"someone" wrote in message <l5dn66$hhb$>...
> "Deiniol" wrote in message <l5dcs5$sfn$>...
> > Hi,
> >
> > I trying to create a plot which will represent a profile from a geophysical survey. I have so far plotted a line to represent the ground topology and the topology of a sub-surface layer. What I would like to know is, is it possible to shade the area between these two plotted lines and have the colour change to represent changing resistivity? if this is possible how would I go about that?
> >
> > Cheers,
> >
> > Deiniol

> % Perhaps
> doc area
> % will help. Look at the Examples section.

Also, if your resistivity data is more of a continuous function, rather than discrete blocks, you can achieve the effect using patches:

x = 1:100;
y = rand(1,100);
c = sin(x);
xq = [x(1:end-1); x(2:end); x(2:end); x(1:end-1); x(1:end-1)];
yq = [y(1:end-1); y(2:end); zeros(2, nx-1); y(1:end-1)];
cq = [c(1:end-1); c(2:end); c(2:end); c(1:end-1); c(1:end-1)];
patch(xq, yq, cq, 'edgecolor', 'none')

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.