Consider the following test data:
reg1 = RegionPlot[(x^2 + y^2) <= 1 || 2 <= (x^3 + y^2) <= 5, {x, -3,
3}, {y, -5, 5}];
reg2 = RegionPlot[(x^2 + y^3) <= 1 || 2 <= (x^3 + y^2) <= 5, {x, -3,
3}, {y, -5, 5}];
sens1 = Cases[Normal@reg1, Line[x_] :> x, Infinity];
sens2 = Cases[Normal@reg2, Line[x_] :> x, Infinity][[1]];
sens1
includes two tables with data, while sens2
is just one table.
I want to plot the data from sens1
in one color and the data from sens2
in another. For this specific example, I may simply use
ListPlot[{sens1[[1]],sens1[[2]], sens2}, Joined -> True, AspectRatio -> Automatic,PlotStyle -> {{Thick, Blue}, {Thick, Blue}, {Thick, Darker@Red}, {Thick, Gray}}]
However, what should I do if the dimensions of sens1
and sens2
are a priori unknown?
Edit
What if additionally I need to show plot legends, one legend label per all belongings of sens1
and sens2
? Again, if the dimensions are known a priori, I may just plot something like
ListPlot[{sens2,sens1[[1]],sens1[[2]]}, Joined -> True, AspectRatio -> Automatic,PlotStyle -> {{Thick, Darker@Red},{Thick, Blue}, {Thick, Blue}}, PlotLegends -> Placed[Style[#, 15] & /@ {"2","1"}, {0.2, 0.15}]]
But it is not clear to me what to do if the dimensions are unknown.