# Colour Change of a Convex Hull

I have the following code to draw a convex hull.

P0={0,0};
P1={1,0};
P2={-1,0};
R[1]=ConvexHullMesh[{P0,P1,P3},Frame-> True,PlotRange->Automatic ]
Show[Region[R[1],PlotRange->{{-1.2,1.2},{-1.2,1.2}},Axes->True,ImageSize->Medium],Graphics[Text["(0,0)",{0,0}]],Graphics[Text["(0,1)",{0,1}]],Graphics[Text["(1,0)",{1,0}]],Graphics[Text["Choice [1,2] and [6,2]",{0.7,1}]]]


Now I want to change the color of the convex hull. I tried PlotStyle but it was not working. Can you suggest me an option to change the color from the default light blue? I'm very new to drawing plots in Mathematica. You can also give me advice on how to improve my drawing for future. Thanks.

To style primitives in a MeshRegion object you can use MeshCellStyle:

P0 = {0, 0};
P1 = {1, 0};
P2 = {0, 1};
R[1] = ConvexHullMesh[{P0, P1, P2}, Frame -> True,
PlotRange -> Automatic, MeshCellStyle -> {2 -> Opacity[.5, Red]}]


Show[Region[R[1], PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}},
Axes -> True, ImageSize -> Medium], Graphics[Text["(0,0)", {0, 0}]],
Graphics[Text["(0,1)", {0, 1}]], Graphics[Text["(1,0)", {1, 0}]],
Graphics[Text["Choice [1,2] and [6,2]", {0.7, 1}]]]


An alternative way to add text labels using the options Epilog and MeshCellShapeFunction:

ConvexHullMesh[{P0, P1, P2}, Frame -> True, Axes -> True,
MeshCellStyle -> {2 -> Opacity[.5, Red]},
PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}},
MeshCellShapeFunction ->
{{0, 1 | 2} -> (Text[Style[Round@#, Opacity[1], Black, 12], #, {0, 1.2}] &),
{0, 3} -> (Text[Style[Round@#, Opacity[1], Black, 12], #, {0, -1.2}] &)},
Epilog -> Text["Choice [1,2] and [6,2]", {0.7, 1}]]


• Thanks a lot. Is it also possible to increase the font size of the axis coordinates? Because when I make the plot smaller it is hard to read the coordinates unless we zoom in. Commented Apr 18, 2020 at 15:17
• @Sumit, you can add the option FrameTicksStyle -> 14 or the option LabelStyle -> 14 .
– kglr
Commented Apr 18, 2020 at 15:22
• Thanks. It worked. Commented Apr 18, 2020 at 16:58