Change model color on pdegplot and pdeplot3D
24 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Santiago
le 3 Fév 2022
Réponse apportée : Sourav Karmakar
le 14 Fév 2022
I'm a newbie on PDE Toolbox on MATLAB, by default it plots the sphere gray when I use 'pdegplot'
radiusE = 230
gm = multisphere(radiusE)
model = createpde
model.Geometry = gm
pdegplot(model,'CellLabels','on','EdgeLabels','on')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/883640/image.bmp)
And when I plot the model meshed with pdeplot3D, it turns to cyan, when I open the function I see a paramater "Facecolor" on cyan, but I can't manipulate It.
generateMesh(model)
pdeplot3D(model)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/883645/image.bmp)
0 commentaires
Réponse acceptée
Sourav Karmakar
le 14 Fév 2022
Hey Santiago ,
As per my understanding, you want to change the ‘FaceColor’ property of pdegplot and pdeplot3D plot figures. You can not change the ‘FaceColor’ property as an input argument to the "pdegplot" or "pdeplot3D" . You can refer to the following document to see the list of valid name-value pair arguments that can be passed as input to "pdegplot" and "pdeplot3D" :
So, to change any property in the plot, first store the plot in a handle and set value to that property using dot method on the handle. For example,
radiusE = 230;
gm = multisphere(radiusE);
model = createpde;
model.Geometry = gm;
p = pdegplot(model,'CellLabels','on','EdgeLabels','on'); %store the plot in a handle (here, it’s p)
p % Here, you can see all the plot properties
p.FaceColor = [1 0 0]; %Now, you can set any [r g b] value to ‘FaceColor’ property
Do same for the "pdeplot3D" in order to change the face colour.
Hope this helps!
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!