display difference between Matlab plot and Matlab App-Designer

I tried to implement the plotting function to a App-Designer, but I found that the plot display is slightly different:
the first figure below is plot in Maltab using regular functions. the second is what is shown in the App-Designer. the difference is the back ground color not consistently white. I tried to set the background color in App-designer to 'w' but this is what is has. how to handle the rest of it?
Thanks!
Yu

 採用された回答

Cris LaPierre
Cris LaPierre 2018 年 12 月 8 日

0 投票

I suspect if you rotate the figure in MATLAB, you would see the same behavior.
You haven't set the background color to white. You've set the box color to white (the default color) in both. You can set the background color in app designer by selecting you axes in design view and then, in Axes properties > Color and Transparency Maps, locate the setting for Background Color and set it to what you want it to be (white?).
Incidentally, you can also set box color through a similar process, but go to Axes properties > Box Styling and change the Color property to what you want it to be.

3 件のコメント

Yu Li
Yu Li 2018 年 12 月 8 日
Thanks for your reply. I did not rotat the figure at all
I reproduce the what is shown in the App-designer steps below:
  1. plot
1.JPG
2. add title
2.JPG
3. add colorbar
3.JPG
during these steps I do not do any operation, just pause at each step and make a screenshot.
the result of : app.Cylinder_display.Color
is: [1,1,1]
this indicates white, right?
I appreciate you response.
Yu
Cris LaPierre
Cris LaPierre 2018 年 12 月 8 日
What is your plot command in app designer?
It seems you missed the part in my previous response that told you how to set the background to white.
Yu Li
Yu Li 2018 年 12 月 8 日
編集済み: Yu Li 2018 年 12 月 8 日
I open answer to your question, please see below.

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

その他の回答 (1 件)

Yu Li
Yu Li 2018 年 12 月 8 日

0 投票

Thanks for your reply.
in App-Designer, the command is:
trisurf(t, Data(:,1), Data(:,2), Data(:,3), 'CData', Data(:,4), 'EdgeColor', 'none','Parent',app.Cylinder_display);
in normal Matlab, the command is:
trisurf(t, Data(:,1), Data(:,2), Data(:,3), 'CData', Data(:,4), 'EdgeColor', 'none')
you need to download the surface reconstruction toolbox here:
I attached the Data for you to test.
2. the command:
the default color is 'w'
app.Cylinder_display.Color='w'
make no change to the backgroud color,
if using: app.Cylinder_display.Color='r', below is the result:
4.JPG
Thanks!
Yu

4 件のコメント

Cris LaPierre
Cris LaPierre 2018 年 12 月 8 日
編集済み: Cris LaPierre 2018 年 12 月 8 日
You are setting the box color with that command.
Again, to set the background color in app designer, select the axes in Design View and then, in Axes properties > Color and Transparency Maps, locate the setting for Background Color and set it to what you want it to be (white?).
Yu Li
Yu Li 2018 年 12 月 8 日
Yes, I set it to white....
is there any mistake with my operation?
5.JPG
Thanks!
Yu
Cris LaPierre
Cris LaPierre 2018 年 12 月 9 日
It looks like we have different versions of MATLAB. I am runing 2018b.
You could try to set it programmatically:
app.UIAxes.BackgroundColor = 'w';
Here's what it looks like for me.
appAxesBckgrndColor.png
Yu Li
Yu Li 2018 年 12 月 9 日
Thanks for your reply.
Yes, my version is 2017b. after setting like your suggestion, the problem has been solved, thank you.

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

カテゴリ

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

質問済み:

2018 年 12 月 8 日

コメント済み:

2018 年 12 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by