I am trying to plot multiple curvers using the “Plot” function. I would like to shade below one of the curves, but not fill for any other curves. The line in my Mathematica notebook is “Plot[{V, -0.5, 0.5, 2, 8, 16}, {x, -3, 3}, Filling → Bottom]”. I can’t seem to get the horizontal lines to plot without them filling. Could someone please tell me what fill options I need to use to be able to fill according to one line, but have no fill for other lines plotted on the same plot?
The Filling option can take a list of rules that describes the filling. This one says for example to only fill from the first function to the bottom:
Plot[{Sin[x], 0.1, 0.3}, {x, 0, 10}, Filling -> {1 -> Bottom}]
If you are not comfortable with the Filling syntax, make multiple Plots and put them together with Show:
p1=Plot[Sin[x], {x, 0, 10}, Filling->Bottom];
p2=Plot[{0,1,0.3}, {x, 0, 10}];
Show[p1,p2]
Arnoud,
That does exactly what I need! Thank you!
Allen
Glad Sean and I could help. Thanks for using Mathematica!
