I’m searching for a method to plot groups of data on a scatter plot. I thought I found a way on the MATLAB Documentation Center (small car example is very similar to what I’m hoping to do).
Unfortunately, my work center doesn’t have the Statistics Toolbox containing the gscatter command.
To make matters more interesting, the groups of data are dynamic, changing from one set to the next.
Does anyone aware of such a method in MATLAB?
"small car example" is this what you refer to?
load carsmall gscatter(Weight,MPG,Model_Year,'','xos')
"annotate a group" I don't understand what you mean. gscatter does not have an annotate option, or does it?
When posing a question try to make it simple to answer.
Something similar to the carsmall plot can be created with
plot( x1, y1, ... ) hold on plot( x2, y2, ... ) plot( x3, y3, ... ) legend( ..... )
The two subsequent plots might(?) change the range of the axes. My way of fixing that is
axh = gca; set( axh, 'Xlim', [0,2] ) set( axh, 'Ylim', [0,2] )
However, there is a special command
which operates on the current axes.
There is also a low level way:
Play games and win prizes!Learn more