Hello colleagues!!
I have an issue with the Filling parameter in a ListPlot. I constructed an equilateral triangle of length 1, where I plot some points in barycentric coordinates, describing a curve and a line when joined (see attachment).
For the model I'm describing, I need to fill with color the upper right region, inside the triangle, defined by a segment of the red line, a segment of the blue curve, and a segment of the right side of the triangle. The region seems like a right triangle, the hipotenuse being 'curve' (actually, the red line and the right side of the triangle are perpendicular).
I tried to use the Filling option of the ListPlot command, but I'm almost convinced that it's impossible to fill the described region using Filling. I'm currently working on another approach to put color in this region, but I think this could be a nice problem for anyone of you. Hats off for the one who can solve it, and thank you in advance!!
Daniel
PD: Here's some code to replicate the exact figure:
k1 = Table[0.01 i, {i, 0, 100}];
yLine = k1 Sqrt[3]/2;
xLine = (Sqrt[3] k1 + yLine)/Sqrt[3];
k3 = Table[
Solve[{x k1[[i]] == y 1/4, k1[[i]] + x + y == 1}, {x, y}], {i,
1, 101}][[All, 1]][[All, 1]][[All, 2]];
k4 = Table[
Solve[{x k1[[i]] == y 1/4, k1[[i]] + x + y == 1}, {x, y}], {i,
1, 101}][[All, 1]][[All, 2]][[All, 2]];
yCurve = k3 Sqrt[3]/2;
xCurve = (Sqrt[3] k4 + yCurve)/Sqrt[3];
leftSide = Table[Sqrt[3] k1[[i]], {i, 1, 51}];
rightSide = Table[-Sqrt[3] (k1[[i]] - 1), {i, 51, 101}];
bottomSide = Table[0, {i, 1, 101}];
ListPlot[{Transpose[{k1, bottomSide}],
Transpose[{k1[[1 ;; 51]], leftSide}],
Transpose[{k1[[51 ;; 101]], rightSide}], Transpose[{xLine, yLine}],
Transpose[{xCurve, yCurve}]}, AspectRatio -> Sqrt[3]/2,
PlotRange -> {{0, 1}, {0, Sqrt[3]/2}}, Joined -> True,
PlotStyle -> {Black, Black, Black, Red, Blue}]
Attachments: