how to change the type of points for a plot
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
JR
am 9 Okt. 2020
Kommentiert: Star Strider
am 9 Okt. 2020
Hello,
I have a plot with different points (corresponding to different trials) and I would like to modify the type of points in my plot.
I would like to put the number of each row of my table instead of a cross or a dot.
How can I do this kind of thing?
Thank you in advance.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 9 Okt. 2020
This should get you started:
x = 1:10; % Create Data
y = rand(size(x)); % Create Data
figure
plot(x, y, '.', 'Color','none') % Plot Colourless Dots
grid
datalbl = compose('%d',x); % Create Point Labels
text(x, y, datalbl, 'HorizontalAlignment','center', 'VerticalAlignment','middle') % ‘Plot’ Point Labels
.
4 Kommentare
Star Strider
am 9 Okt. 2020
My pleasure!
Try this:
x = rand(1,50); % Create ‘x’ Data
y = rand(size(x)); % Create ‘y’ Data
Trial = 1:numel(x); % Create ‘Trial’ Identifiers
figure
plot(x, y, '.', 'Color','none') % Plot Colourless Dots
grid
datalbl = compose('%d',Trial); % Create Point Labels
text(x, y, datalbl, 'HorizontalAlignment','center', 'VerticalAlignment','middle', 'FontSize',8) % ‘Plot’ Point Labels
It is a slight variation on my earlier code. It should be straightforward for you to adapt it to your data.
Experiment with it to get the result you want.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

