Square Gridlines in figure

조회 수: 15 (최근 30일)
rowJoe
rowJoe 2013년 1월 14일
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?
  1. Boundary conditions:
  • all figures are 2D
  • data are stored in a 5D-matrix
  • y-axis: range from 0 to 1 with 0.05 steps, fix for each figure!
  • x-axis: range varied in each figure (according to data range stored in 5D matrix)
  • fix size/format of each figure: DIN-A5
  1. Examples of the plotted figures (gridlines are not squared!):
Thanks for your help in advance!
  댓글 수: 1
Jan
Jan 2013년 1월 14일
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?

댓글을 달려면 로그인하십시오.

답변 (3개)

Image Analyst
Image Analyst 2013년 1월 14일
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.
  댓글 수: 1
rowJoe
rowJoe 2013년 1월 14일
Thanks for your comment. As you can see at the two examples in my answer on Jans comment above, I used "grid on". But the grid is rectangular and the size of the grid varied from figure to figure - the rectangles have in every figure another size.

댓글을 달려면 로그인하십시오.


Jan
Jan 2013년 1월 15일
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?
  댓글 수: 1
rowJoe
rowJoe 2013년 1월 15일
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!

댓글을 달려면 로그인하십시오.


Jan
Jan 2013년 1월 19일
You can try to set the position of the axes object in absolute units 'centimeters'. Then you have more control over the output to paper. But even then more experiments are required and there is no trivial solution.

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by