I think matlab plot position code is incorrect, the plot position values output are not right...help!?

3 Ansichten (letzte 30 Tage)
i need help, this code completely replicates my problem. is this an issue with just my computer? version of matlab? Or do I have a fundemental misunderstanding about what these numbers mean. I understand them to be in order, units away from the bottom left corner x dim, then y dim, then width and height. Help please
h = figure
plot(rand(10, 1))
h.Units= 'pixels';
h.Position = [3.2394e+03 524.2000 496.8000 340.8000]
%or if you dont have 2 monitors
h.Position (1:2) = 100
axis square
% the numbers I got from the pictures uploaded using autohotkey to measure pixels are below
% I also measured using come calipers and the axes are the same size IRL which is consistant with
% autohotkey and 'axis square'
BL = [1188, 1053];
BR = [1536, 1051];
TL = [1189, 705];
xLengthPx = BR(1) - BL(1)
yLengthPx = BL(2) - TL(2)
xLengthPx =
348
yLengthPx =
348
plotSize = getpixelposition(gca)
plotSize =
65.5840 38.4880 385.0200 277.7520 % the output in pixels are nowhere near the real values
plotSize = plotboxpos(gca) % on file exchange
plotSize =
0.2380 0.1100 0.5591 0.8150 % the ratios of x and y lengths are nowhere near 1 as they
%should be
IMG_6950.jpgIMG_6951.jpgIMG_6952.jpg

Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by