Is there an easy way to redirect the output of gscatter to a previously defined axes handle?
2 次查看(过去 30 天)
显示 更早的评论
We are developing a GUI that has a drop box to select the plot type. These different plot types plot in the same figure and axes. We would like to use gscatter from the Statistics Toolbox, but it seems to have no way to redirect its output to a pre-defined figure and axes. Anyone know a way to do this.
0 个评论
回答(1 个)
Razvan
2012-10-10
Probably you just need to make the important axes the current axes. For example:
figure
hax1 = subplot(2,1,1);
hax2 = subplot(2,1,2);
load discrim
axes(hax1)
gscatter(ratings(:,1),ratings(:,2),group,'br','xo')
If you use
axes(hax1)
to make hax1 the current axes, then the plot is made in this axes (upper panel). Otherwise it is made in the current axes hax2 (lower panel)...
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!