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!