# How to make a filled Ellipsoid?

I want to make a filled Ellipsoid, but it seems Filling options doesn't work in Graphics options. I have a matrix

matrix1={{1,4},{6,8}}


thus I plot en ellipse from his Eigenvalues and Eigenvectors

valmat = Eigenvalues@matrix1;
vecmat = Eigenvectors@matrix1;
pair = {0.5, 0.5}
ellips1 =
Ellipsoid[pair, {Abs[valmat[[1]]], Abs[valmat[[2]]]}, {vecmat[[1]], vecmat[[2]]}];
plot1 = Graphics[{Red, ellips1}, GridLines -> Automatic,
GridLinesStyle -> Directive[Gray, Dotted]];
partot1 =
Show[plot1, Frame -> True,
FrameLabel -> {Style["x", 18], Style["y", 18]}, AspectRatio -> 1,
FrameTicks -> {Automatic, Automatic, None, None},
LabelStyle -> Directive[13], ImageSize -> 500]


The question is how to filled this ellipse with an specific color??..and also (if it's possible) the transparency on that. Thanks

-
What's Ellipsoid, what pacage is required? –  Kuba Sep 20 '13 at 13:38
@Kuba Needs["MultivariateStatistics"] –  ybeltukov Sep 20 '13 at 13:38
Perhaps use Disk? –  bobthechemist Sep 20 '13 at 13:39
Use a disk, scale the axis and rotate. –  rm -rf Sep 20 '13 at 13:40
Also, ellipsoid is a graphics, so you need to use faceform/edgeform. See this answer where I use an ellipsoid. –  rm -rf Sep 20 '13 at 13:42

If there is nothing else:

partot1 /. Line -> Polygon


partot1 /. Line[x_] -> {Green, EdgeForm@Thick, FaceForm[Opacity@.5], Polygon[x]}


Fortunatelly Elipsoid is not ReadProtected so you can use ?? to se the UpValues related to it. (I suggest to Ctrl+F and replace/delete all contexts: MultivariateStatisticsPrivate so the code will be transparent)

Really quick and not elegant fix for 2d case:

style[opts__, x_Ellipsoid] := Graphics[x] /. Line[y_] :> {opts, Polygon[y]} // First

ellips1 = Ellipsoid[{0.5, 0.5}, {10., 1.52}, {{0.4, 1.}, {-1.58, 1.}}];

Graphics[{
style[Red, ellips1],
Rotate[style[Green, EdgeForm@Thick, Opacity@.5, ellips1]
, Pi/2]
}, Frame -> True ]


You can use ?? like I said before to create more general solution, unfortunatelly I'm run out of time now :/. Good luck.

-
@AlejandroGuarnizo I'm glad you like it. It is good habit to hold on with an accept a little bit. It can discourage otheres. Here for example might be some easy fix I don't know because I'm not familiar with this package :) –  Kuba Sep 20 '13 at 14:00
Thanks @Kuba for your answer, it works. But now I have other one. What if instead one ellipse, I have two. It seems there is no way to show somehow one behind the other? –  Alejandro Guarnizo Sep 20 '13 at 14:06
@AlejandroGuarnizo The overlap problem is much harder and has been discussed a number of time in this site. A quick search shows this mathematica.stackexchange.com/questions/28997/…. Id suggest if you cant find a satisfactory existing answer you should post that as a new question. –  george2079 Sep 20 '13 at 14:27
another link: mathematica.stackexchange.com/questions/11146/… –  george2079 Sep 20 '13 at 14:32
@AlejandroGuarnizo Take a look at my edit, does it work for you? –  Kuba Sep 20 '13 at 19:33