Axes ticks labeling in contourf
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Shani Gal
am 19 Feb. 2012
Bearbeitet: Matt J
am 16 Okt. 2013
Hi
How do I label the X and Y ticks in contourf ? if I have a 20x30 matrix, when I use contourf the x-axis is labeled from 0 to 20 and the y from 0 to 30, how do I change it to different values ( for example the x should be from 100 to 120 and the y from 200 to 230)
Thanks
Shani
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 19 Feb. 2012
Provide the x and y values at the time of the contourf() call.
contourf(X,Y,Z), contourf(X,Y,Z,n), and contourf(X,Y,Z,v) draw filled contour plots of Z using X and Y to determine the x- and y-axis limits. When X and Y are matrices, they must be the same size as Z and must be monotonically increasing.
0 Kommentare
Weitere Antworten (1)
the cyclist
am 19 Feb. 2012
For example:
set(gca,'XTick',100:2:120,'XTickLabel',100:2:120)
EDIT IN RESPONSE TO COMMENT:
Here is a fuller example:
z = peaks;
figure
contourf(z);
set(gca,'XTick',10:10:40,'XTickLabel',10:10:40)
"gca" means "get current axis".
2 Kommentare
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!