How to give option to change plot properties(e.g. color, line width, line style) in matlab app designer ?

43 ビュー (過去 30 日間)
This will be similer to figure properties option available if graph is plotted in a matlab script.
Like shown in below figure...we can change the lineWidth and color of chosen line graph if we plot it using matlab scripts. I want give option like this in my app developed using matlab app designer
  2 件のコメント
Ngo Nguyen
Ngo Nguyen 2021 年 4 月 19 日
Did you try this? https://www.mathworks.com/help/matlab/creating_guis/graphics-support-in-app-designer.html
Vinayak Untwale
Vinayak Untwale 2021 年 4 月 19 日
Hi, checked the link but its not related to my question...I have updated by question...plzz could you take a look again?

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

採用された回答

Aghamarsh Varanasi
Aghamarsh Varanasi 2021 年 4 月 22 日
編集済み: Aghamarsh Varanasi 2021 年 4 月 22 日
Hi Vinayak,
You can customize the plot in a app developed in MATLAB app designer by setting the properties of the plot. For example,
- Let us assume that a line is plotted on the UIAxes in app designer as follows,
plot(app.UIAxes, 1:2:10, 1:5:25);
- The properties of the plotted line can be set as follows,
% get the handles to the plotted lines
h = app.UIAxes.Children;
% get handle of a single line plot
line1 = h(1);
% change the properties of the line plot based on user input.
line1.Color = 'r';
line1.LineWidth = 2;
User input can be taken from a 'edit field' or 'drop down'.
Here is a link to a similar question.
Hope this helps

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by