Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Shading area under a graph to represent another variable.
Posted:
Nov 6, 2013 12:27 PM


"someone" wrote in message <l5dn66$hhb$1@newscl01ah.mathworks.com>... > "Deiniol" wrote in message <l5dcs5$sfn$1@newscl01ah.mathworks.com>... > > 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 subsurface 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:end1); x(2:end); x(2:end); x(1:end1); x(1:end1)]; yq = [y(1:end1); y(2:end); zeros(2, nx1); y(1:end1)]; cq = [c(1:end1); c(2:end); c(2:end); c(1:end1); c(1:end1)]; patch(xq, yq, cq, 'edgecolor', 'none')



