# how to make figure perfectly squared?

조회 수: 6(최근 30일)
MP 2022년 8월 24일
댓글: Walter Roberson 2022년 8월 24일
I would like to make a perfect squared figure. When I use axis equal I still find that y-axis is stretched more than x-axis and does not make a perfect square. It appears like a rectangle elongated in y-direction. I do not want to change x and y limits.
I understand that my PC screen does not have 1:1 ratio, but how to get figure in 1:1 ratio??
Here is the tentative code:
clear; close all; clc;
subplot(131)
plot((1:20),(5:5:100))
xlim([1,20]); ylim([5,100]);
axis normal;
axis square;
subplot(132)
plot((1:20),(5:5:100))
xlim([1,20]); ylim([5,100]);
axis normal;
axis square;
subplot(133)
plot((1:20),(5:5:100))
xlim([1,20]); ylim([5,100]);
axis normal;
axis square;
I want a figure like this . Square.
Any help will be greatly appriciated.
Thank you very much in advance!

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

### 채택된 답변

Walter Roberson 2022년 8월 24일
편집: Walter Roberson 2022년 8월 24일
You will need to create a calibration pattern and record it with some external camera, and create an undistortion matrix. You would draw into an array instead of on to the display, and then you would apply the undistortion matrix to it to arrive at the final image to display. The image would then pass through the distortion of your pc display and the distortion and undistortion would cancel out.
The computer vision toolbox contains tools for analyzing camera distortion that could be applied in reverse.
If this sounds as if I am blaming your pc display or your graphics hardware for not displaying correctly, then you have understood correctly.
##### 댓글 수: 2표시숨기기 이전 댓글 수: 1
Walter Roberson 2022년 8월 24일
There are several different standard types of distortion for CRT displays, including pincushioning and bowing.
LCD and OLED and QLED displays are considerably less prone to some kinds of distortions, but they are not free of distortion, especially if viewed at angles.
Those are distortion at the physical display level. There is also potential distortion if the graphics card is sending incorrect or less-than-optimal information, due to settings or problems with the graphics driver or problems with the graphics card.
In the past I have used axis square on my iMac and measured the size of a data rectangle with digital calipers. On my system, the lengths of the two sides was equal to within round-off error.

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

### 범주

Find more on Annotations 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!

Translated by