Change model color on pdegplot and pdeplot3D

43 ビュー (過去 30 日間)
Santiago
Santiago 2022 年 2 月 3 日
回答済み: Sourav Karmakar 2022 年 2 月 14 日
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)

採用された回答

Sourav Karmakar
Sourav Karmakar 2022 年 2 月 14 日
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 件)

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by