3
$\begingroup$

I am trying to replicate the diagram below with grid lines, lines, areas, and labels (corners, coordinates, lines, and areas).

enter image description here

The blue line can be characterized by a line between the points {0.5,0,0.5} to {0.5,0.5,0} or x=.5. The red line can be characterized by a line between the points {0.5,0.5,0} to {0,0.5,0.5} or y=.5. The black line can be characterized by a line between the points {0.5,0,0.5} to {0,0.5,0.5} or x=.5.

Point "a" is just {1/3,1/3,1/3}.

The orange area is y>=0.5 with x+y+z=1. The grey area overlaps partially with z+0.5y>=0.5 and x+y+z=1.

I identified two possibilities (triangle, TernaryListPlot) but got stuck with each.

Option 1: Triangle

Here the coordinates are off and labeling/grid lines seem intensive work:

Show[Graphics[{Line[{{0, 0}, {1, 0}, {.5, Sqrt[3]/2}, {0, 0}}],RGBColor[0, 1, 0], Line[{{0.5, 0}, {0, 0.5}}]}]]

Option 2: TernaryListPlot

Here the diagram structure is there but everything is based on data points and I can't transition from points to lines and areas.

TernaryListPlot[{{0.15, 0.30, 0.55}, {0.25, 0.70, 0.5}, {0.40,0.50,0.10}, {0.80,0.0,0.20}, {0.55, 0.35, 0.10}, {0.30, 0.45, 0.25}, {0.15, 0.40, 0.45}, {0.80, 0.15, 0.05}, {0.45,0.30,0.25}, {0.25, 0.10, 65}}, FrameLabel -> {"A", "B", "C"}]

Thank you in advance for any hints and help!

$\endgroup$

1 Answer 1

7
$\begingroup$
a = {1/3, 1/3, 1/3};
b = {0.2, 0.2, 0.6};
c = {0.4, 0.2, 0.4};
TernaryListPlot[{
  {a -> "a"}
  , {Callout[b, "b", Below, Automatic, Appearance -> "CurvedLeader"]}
  , {Callout[c, "c", Above, Appearance -> "Balloon"]}}
 , PlotStyle -> {Black, None, None}
 , FrameTicksStyle -> 
  Directive[FontFamily -> "Times", FontSize -> 14]
 , GridLines -> True, GridLinesStyle -> LightGray
 , FrameTicks -> Range[0, 1, .2]
 , Prolog -> {{Orange, 
    Polygon[{{0, 0, 1}, {0.5, 0, .5}, {0, 0.5, 0.5}}]}
   , {Directive[{Opacity[0.8], GrayLevel[.75]}], 
    Polygon[{{0, 0, 1}, {1, 0, 0}, {0.5, 0.5, 0}}]}
   , {Red, Thick, Line[{{0, 0.5, 0.5}, {0.5, 0, 0.5}}]}
   , {Black, Thick, Line[{{0.5, 0, 0.5}, {0.5, 0.5, 0}}]}
   , {Blue, Thick, Line[{{0, 0.5, 0.5}, {0.5, 0.5, 0}}]}
   , {Text[Style["A", 15], {0, 0, 1}, {6, 2}]}
   , {Text[Style["B", 15], {1, 0, 0}, {-6, 2}]}
   , {Text[Style["C", 15], {0, 1, 0}, {0, -4}]}}, 
 PlotRangePadding -> 0.2]

enter image description here

Appendix (reply to comment)

By use the similary way in my another answer (https://mathematica.stackexchange.com/a/272686/72111),we can plot the region in TernaryListPlot.

Clera[ternary,reg,reg1,sol];
ternary[{p1_, p2_, p3_}] = {p1 + 1/2 p2, Sqrt[3]/2 p2};
reg = ImplicitRegion[{4 x >= .5, z + 5 y >= .5, {x, y, z} >= 0, 
    x + y + z == 1}, {x, y, z}];
reg1 = ParametricRegion[{{x + y/2, Sqrt[3]/2 y}, {4 x >= .5, 
     5 y + (1 - x - y) >= .5, x >= 0, y >= 0, 1 - x - y >= 0}}, {x, 
    y}];
sol = {x, y, z} /. 
   FindInstance[{x, y, z} ∈ reg, {x, y, z}, 10];
TernaryListPlot[sol, 
 Prolog -> {LightBlue, 
   DiscretizeRegion[TransformedRegion[reg, ternary]]}, 
 PlotStyle -> Red]
TernaryListPlot[sol, Prolog -> {LightBlue, DiscretizeRegion[reg1]}, 
 PlotStyle -> Red]

enter image description here

$\endgroup$
3
  • $\begingroup$ Thank you! Do you know if the areas can also be illustrated with plotregion instead of polygons with coordinates? For example, I want to illustrate later conditions of various areas (like ax=>0.5 and z+by>=0.5), where I can vary inputs of a and b without providing numerical values of the coordinates. $\endgroup$
    – Tom
    Aug 29, 2022 at 19:43
  • $\begingroup$ @Tom I think we can do this by the method in my another answer, but need time to adjust the code. mathematica.stackexchange.com/a/272686/72111 $\endgroup$
    – cvgmt
    Aug 29, 2022 at 23:48
  • $\begingroup$ Thank you for the update, and much appreciated! It's a new command in 13.1, and it's tricky to find many examples so far. $\endgroup$
    – Tom
    Aug 31, 2022 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.