How to plot grouped data
2 次查看(过去 30 天)
显示 更早的评论
I want to plot a scatter plot of four different features like this: https://en.wikipedia.org/wiki/Iris_flower_data_set#/media/File:Iris_dataset_scatterplot.svg
I used a command gplotmatrix and plot a data as i want, but i also want that in Row#1 and Column#1 there is a name of feauture as in the iris data set.
1 个评论
回答(1 个)
Gillian Rosen
2017-3-14
Hi Abdullah,
To add text to a plot interactively, you can use the 'gtext' function. Input your desired text with the 'gtext' function, and a cursor will appear in your figure window. Click where you would like the text to be placed, and it will appear. See the following documentation link for examples and more information:
If you would like to add text programmatically, you can use the 'text' function instead. With this function, simply specify your desired X and Y coordinate for the location of your text along with the text itself. See the following documentation for more information:
If you would like the sub-plots with text to have no data points, as in the image you provided of the iris data, you can turn the Visibility property of the points in those plot sections to 'off'. You can do this interactively with the following steps:
1. Open the 'Plot Tools' window by clicking the corresponding icon in the figure window toolbar.
2. Select the data that you would like to remove by clicking on it.
3. In the Property Editor at the bottom of the window, click 'More Properties...'
4. In the small 'Inspector' window that appears, scroll down to the 'Visibility' property and click the checkbox to toggle visibility.
Using these steps, you should be able to produce a plot very similar to your desired iris plot.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!