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

2 vues (au cours des 30 derniers jours)
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.

Réponses (1)

Sudhanshu Bhatt
Sudhanshu Bhatt le 23 Juil 2015
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

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by