Filter löschen
Filter löschen

Change model color on pdegplot and pdeplot3D

24 Ansichten (letzte 30 Tage)
Santiago
Santiago am 3 Feb. 2022
Beantwortet: Sourav Karmakar am 14 Feb. 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')
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)

Akzeptierte Antwort

Sourav Karmakar
Sourav Karmakar am 14 Feb. 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!

Weitere Antworten (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by