Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1310

Re: Filling Plots to the X-Axis for a Range of X Values

From Peter Breitfeld <phbrf@t-online.de>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Filling Plots to the X-Axis for a Range of X Values
Date Thu, 31 Mar 2011 08:57:18 +0000 (UTC)
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <in1fle$4a2$1@smc.vnet.net> (permalink)
References <imushb$icn$1@smc.vnet.net>
Lines 25
NNTP-Posting-Date 31 Mar 2011 07:57:38 GMT
NNTP-Posting-Host ead44ac5.news.twtelecom.net
X-Trace DXC=^J0IM7UO>dTmmJjon<[c^_C_A=>8kQj6]Y;@_o827nGSBXUiE?=kfX_EFiONJ7[GoVGHDi`TZm8;Q
X-Complaints-To abuse@twtelecom.net
Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!newspump.sol.net!post2.nntp.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
Xref x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:1310

Show key headers only | View raw


Gregory Lypny wrote:

> Hello everyone,
>
> I'd like to fill a plot down to the x-axis but restrict the fill to lie between two x values, and am not sure how to do it.  For example, if I plot a parabola f[x] = x^2, with x in the range =E2=88=9210 to 10, I'd like to be able to fill to the x-axis between x = 2 and x = 7, essentially creating a filled column.  Is there any way to do that?
>
> Regards,
>
> Gregory
>
>

I think you have to make two plots and combine them with Show:

pl1 = Plot[x^2, {x, -5, 10}];
pl2 = Plot[x^2, {x, 2, 7}, Filling -> Axis];
Show[pl1, pl2]

Beware: The order of the plots in Show is critical, if you swap it, Show
will disply pl2 only, because it uses the options of the first plot given.

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Filling Plots to the X-Axis for a Range of X Values Gregory Lypny <gregory.lypny@videotron.ca> - 2011-03-30 09:18 +0000
  Re: Filling Plots to the X-Axis for a Range of X Values Chris Degnen <degnen@cwgsy.net> - 2011-03-31 08:59 +0000
  Re: Filling Plots to the X-Axis for a Range of X Values Peter Breitfeld <phbrf@t-online.de> - 2011-03-31 08:57 +0000
  Re: Filling Plots to the X-Axis for a Range of X Values Gregory Lypny <gregory.lypny@videotron.ca> - 2011-03-31 09:00 +0000

csiph-web