Set properties of patch doesn't work

Hello,
I'm trying to plot an isosurface in AppDesigner with:
load chestVolume
mask = 1800 <= V & V <= 3200;
p = patch(isosurface(mask));
p.FaceColor = 'red';
and it works fine.
Now I want to set the BackFaceLightning on 'unlit' and FaceLightning (on something, I don't know) so I can see where the inner surface and where he outer surface of the figure is. But when I set the properties nothing changes. Does anybody know why nothing changes and how I can fix it?

8 件のコメント

Jan
Jan 2020 年 12 月 20 日
You set "FaceLightning (on something, I don't know)" and do not see any changes. I cannot imagine, what this exactly means. Please post a piece of code, which reproduces the problem, if the readers run it by copy&paste.
rocketMan
rocketMan 2020 年 12 月 20 日
I set
p.FaceLightning = 'flat' or p.FaceLightning = 'gouraud' or p.FaceLightning = 'none'
(every available value for FaceLightning-property) and it changes nothing
Jan
Jan 2020 年 12 月 21 日
I cannot read your mind and do not know, what "changes nothing" mean. Please explain explicitly, what you expect instead.
Maybe the problem is the typo in your "FaceLightning", because it contain an addition "n" compared to "FaceLighting".
p = patch;
disp(p.FaceLighting)
p.FaceLighting = 'none'
disp(p.FaceLighting)
What do you get as output? Does something change or not? Do you mean the value or how the patch is displayed?
rocketMan
rocketMan 2020 年 12 月 21 日
by "changes nothing" I mean that after applying the property the output is the same as before. There are, like, no changes.
I made a typo in the question here, of course it is "FaceLighting", otherwise Matlab would have thrown an exception, so that was not the problem.
I tried the code you suggested, but like before, no changes on the output were detected.
Jan
Jan 2020 年 12 月 21 日
Sorry for asking again, but questions for clarifications are a standard event during finding a solution:
Does the code I have posted really display:
flat
flat
or is the 2nd output 'none'? If the output does not change, your Matlab installation is corrupted and I'd recommend a re-installation. Maybe you are working with admin privileges and have overwritten a function belonging to Matlab's toolboxes.
By the way, the code I have posted is expected to display the same graphical objects: The scene does not contain a light() yet, that the lighting has no effect. Maybe this is the solution you are searching for, but I'm still at the level of finding out, what you observe at all.
rocketMan
rocketMan 2020 年 12 月 21 日
it prints
flat
none
Jan
Jan 2020 年 12 月 21 日
Okay, so the is a change. But the displayed object does not change, because there is no light() object, which could influence the lighting?
rocketMan
rocketMan 2020 年 12 月 22 日
Yes, I suppose so

サインインしてコメントする。

回答 (1 件)

Mario Malic
Mario Malic 2020 年 12 月 21 日
編集済み: Mario Malic 2020 年 12 月 21 日

0 投票

After you change properties, try with drawnow.
Wrong(FaceColor, FaceAlpha, EdgeColor, LineStyle are the only properties for patch.)

8 件のコメント

rocketMan
rocketMan 2020 年 12 月 21 日
Walter Roberson
Walter Roberson 2020 年 12 月 21 日
patch has a lot of properties. Only some of them are displayed by default.
rocketMan
rocketMan 2020 年 12 月 21 日
thanks for the tip, but unfortunately it looks still the same
Mario Malic
Mario Malic 2020 年 12 月 21 日
Can you provide the data if possible to test out the commands ourselves?
rocketMan
rocketMan 2020 年 12 月 21 日
the chestVolume is a dataset from Matlab, it should work for you too by "load chestVolume". Just copy the code from the question.
Jan
Jan 2020 年 12 月 21 日
Maybe you own some toolboxes I do not have. load chestVolume does fail due to an unfound file.
rocketMan
rocketMan 2020 年 12 月 22 日
It is the ImageProcessing Toolbox that I use
Walter Roberson
Walter Roberson 2020 年 12 月 22 日

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

質問済み:

2020 年 12 月 20 日

コメント済み:

2020 年 12 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by