Is it possible to fill the region between two ListPlots
' in Show[]
. Something like:
plot1 = ListPlot[f1,Joined->True]
plot2 = ListPlot[f2,Joined->True]
both = Show[plot1,plot2,Filling->{1->{2}}]
my lists f1 and f2 are huge and complicated and has to be computed and plotted separately, i.e. a solution of the form ListPlot[f1,f2,{x,xmin,xmax},Filling->...]
is not what I'm looking for.
Is this possible and how?
Minimal Example:
list1 = Table[-(x - 2)^2 + 1, {x, 0, 3, 0.1}];
list2 = Table[(x - 1)^2, {x, 0, 3, 0.1}];
plot1 = ListPlot[list1, Joined -> True,DataRange -> {0, 3}]
plot2 = ListPlot[list2, Joined -> True,DataRange -> {0, 3}]
both = Show[plot1,plot2]
Here I would like the region between the plots shaded.
As per the comments I should add that:
The lists list1
and list2
two themselves are lists/matrices. They have dimensions such as 6 times 110 each. Then the object temp = {list1, list2}
has Dimension[temp] = {2,6,110}
which cannot be ListPlot
ted straight away.
f1
andf2
points in the sameListPlot
, whatever your lists will be. Isn't contradictory to plot each list separately, to combine them afterwards withShow
instead of plotting them together withListPlot
? $\endgroup$ListPlot[{list1, list2}, Joined -> True, DataRange -> {0, 3}, Filling -> {2 -> {1}}]
. $\endgroup$list1
andlist2
are{110,6}
and the horizontal and vertical coordinates are in respective positions 3 and 5 in the list of 6 variables, then you could certainly useListPlot[{list1[[All, {3 5}]], list2[[All, {3, 5}]]}]
. $\endgroup$