I want to show upto 3 plots(using gscatter) at a time where the user will select an item from pop-up menu or listbox

1 次查看(过去 30 天)
this code UI('Item_name',option) generates my gscatter image in command window,(problem is the 3 plots are same, only difference of colours based on option; so "hold on" does not work in my case) i want to build a GUI for this.

回答(1 个)

Sudhanshu Bhatt
Sudhanshu Bhatt 2015-7-23
Hi Baibhav Vishal,
I am assuming that the data sets are to be represented in the same axis. In this case you could use color and symbol properties of "gscatter" function:
Example:
Figure;
gscatter(xData,yData,group,'rb','+x')
hold on;
gscatter(xData,yData,group,'yg','o.')
In this example: 'rb' and 'yg' correspond to Red, Blue, Yellow and Green colors for the graphs '+x' and 'o.' correspond to the symbols or markers which will represent the data sets.
More information on "gscatter" function can be found in the documentation link below:
If the data sets are to be represented in different axis on the figure then you can make use of "subplot" function:
Example:
figure;
subplot(2,1,1);
gscatter(xData,yData,group);
subplot(2,1,2);
gscatter(xData,yData,group);
This code will create a figure with axis in tiled positions, and datasets plotted in different axis.
More information on "subplot" function can be found in the documentation link below:
Hope this helps.
Thanks
Sudhanshu Bhatt

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by