label individual points in boxplot
3 ビュー (過去 30 日間)
古いコメントを表示
I have a boxplot that summarizes my data, but I'd like to overlay a few of the individual data points that were used to make the boxplot. I currently just have a plot w/ three different categories, but I want to show a few points in each of those categories along with their respective labels.
0 件のコメント
回答 (1 件)
Matt Tearle
2011 年 5 月 11 日
You should be able to use gname. Depending on how your data is organized, you might need to repmat the labels. For example
load cities
boxplot(ratings)
gname(repmat(names,9,1))
In the cities example data set, the names correspond to the rows of the matrix ratings. The boxplot uses each column of ratings as the categories. So if you click on a data point in the 7th column, gname is trying to (linearly) index into element 2000 (or whatever). So doing repmat on the names simply repeats the labels for each of the 9 columns.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!