How to fit a different scale to an existing plot
5 views (last 30 days)
Show older comments
The First image has the numbers 0 - 1386 on the y axis while the second has 812 - 849 on the y axis. I need the second scale on the first graph without having to modify the data in the graph as the data collapses into rows when i need it as shown in the first image.
Using Xtick & Xticklabel unfortunately does not scale the marks as seen in the second graph and either plots them all at the value on the original graph or modifies the graph with the new scale values only
2 Comments
Answers (2)
Kelly Kearney
on 5 Oct 2016
The axis values are set by the x and y values you use when plotting. Try just changing the y values:
x = 1600:10:2500;
y = 0:10:1386;
nx = length(x); ny = length(y);
z = rand(ny,nx);
surf(x,y,z);
vs
y = linspace(812,849,ny);
surf(x,y,z);
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!