Filter löschen
Filter löschen

How to plot grouped data

2 Ansichten (letzte 30 Tage)
Abdullah Danyal Saeed
Abdullah Danyal Saeed am 11 Mär. 2017
Beantwortet: Gillian Rosen am 14 Mär. 2017
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 Kommentar
Chad Greene
Chad Greene am 11 Mär. 2017
Can you provide a sample dataset and a picture of what you want to do?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Gillian Rosen
Gillian Rosen am 14 Mär. 2017
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.  

Community Treasure Hunt

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

Start Hunting!

Translated by