I would like to plot a partially filled/shaded ellipse. The code below shades the whole ellipse. However, I only want to shade the part of the ellipse to the right of the vertical line where x > cutscore.
Needs["MultivariateStatistics`"]
cutscore = 0.5;
data1 = RandomVariate[MultinormalDistribution[{0, 0}, {{1, 0.6}, {0.6, 1}}], 500];
ellipse1 = EllipsoidQuantile[data1, 0.5];
e1 = Graphics[ellipse1];
line1 = Graphics[{Line[{{cutscore, -1.3}, {0.5, 1.5}}]}];
show1SEL = Show[e1, line1, Axes -> {True, False}, AxesOrigin -> {-2, -2},
PlotRange -> {{-2, Automatic}, {-2, Automatic}}];
show1SELfilled = show1SEL /. Line[x_] -> {Green, EdgeForm@Thin, FaceForm[Opacity@.2], Polygon[x]}
EllipsoidQuantile
. This is related: Coloring a shape according to a function. $\endgroup$ – Artes Aug 28 '14 at 22:50EllipsoidQuantile
is defined in"MultivariateStatistics`"
, now added. $\endgroup$ – Chris Degnen Aug 28 '14 at 23:43