I generate with a loop several 2D figures out of data stored in a matrix. The figures have aerodynamic backround so it's indispensable to get squared gridlines. In this context "square" means that the distance between the horizontal and vertical gridlines are the same.
My idea: The lines which belong to the y-axis pretend the distance for the x-grid. But I have no idea to realize this... Can anyone help me?
http://s7.directupload.net/file/d/3135/gvsi25mg_jpg.htm
http://s7.directupload.net/file/d/3135/yt4v4ml8_jpg.htm
Thanks for your help in advance!
No products are associated with this question.
I know it seems obvious, but since you didn't mention it, have you used the "grid on" command? If so, tell us why the "grid on" command does not work for you.
The shown pictures seem like you want to get the ticks in equidistant steps in X- and Y-direction. Then the sections do not look like squares on the paper. Correctly?
X = linspace(0, 100, 10);
Y = rand(1, 10) * 100;
AxesH = axes;
plot(X,Y);
XL = get(AxesH, 'XLim');
YL = get(AxesH, 'YLim');
set(AxesH, 'XTick', XL(1):10:XL(2), ...
'YTick', YL(1):10:YL(2));
Does this help?
Hey Jan,
thanks for posting. The equidistant steps on the X-axis result from the data within the matrix. Matlab calculated these steps with the default settings (these are measured values). On the Y-axis you can see the different measurement points (mostly in equidistant steps). So your example has unfortunately not helped.
The equidistant steps in X- and Y-direction doesn't matter. Important are the squared looking sections on the paper (with given steps on y-axis).
Thanks again!
1 Comment
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/58716#comment_122386
How does your "plot" look exactly? I assume the number of dimensions of your data matrix is not relevant, but it matters if you have a 2D or 3D plot. Does "square" mean, that the grind lines have the same numerical distance, or should they appear with the same width and hight in the printed output?