Is there a way to create and annotate a group scatter plot, without using the gscatter command?

2 ビュー (過去 30 日間)
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?

採用された回答

per isakson
per isakson 2013 年 5 月 16 日
編集済み: per isakson 2013 年 5 月 16 日
"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
xlim([xmin,xmax])
which operates on the current axes.
.
There is also a low level way:
  • create an axes (handle graphic ) object
  • create three line objects, which are children to the axes
  • ...

その他の回答 (1 件)

per isakson
per isakson 2013 年 5 月 15 日
Did you search the File Exchange? Generate Data for Clustering
  2 件のコメント
Brad
Brad 2013 年 5 月 16 日
Per, I did take a look at this. The data I am working with is already generated in groups based on a specific ID for multiple platforms. So Nuno's function won't quite work.
Looks like I will be spec'ing out the Statistics Toolbox.
Thanks for pointing me in this direction.
per isakson
per isakson 2013 年 5 月 16 日
編集済み: per isakson 2013 年 5 月 16 日
IMO:
  • with Matlab one typically achieves a result with a code that contains several lines or more
  • the File Echange is a great source of ideas (and ready made solutions)
  • browsing the File Exchange is worth while
The contribution I picked does not deliver what the picture promises. However, there might be others.

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

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by