4
$\begingroup$

From my knowledge, ImageSize is an option that adjust the width of an image.

Plot[x, {x, 0, 1}, PlotRange -> {{0, 1}, {0, 1}}, Axes -> False, 
  AspectRatio -> Automatic, ImageSize -> 100] // ImageDimensions

{167,167}

Plot[x, {x, 0, 1}, PlotRange -> {{0, 1}, {0, 1}}, Axes -> False, 
  AspectRatio -> Automatic, ImageSize -> 1000] // ImageDimensions

{1667,1667}

The numbe 167, 1667 may be related to 5/3 = 1.66666......

I think it would be better if the result was {100,100} and {1000,1000}.

Where does the ratio 1.66666...... come from ?

$\endgroup$
1

1 Answer 1

4
$\begingroup$

UPDATE

Ian Hojnicki clarifies in the comments:

It’s not really magnification. It’s just how you convert points into pixels. They are different units after all. – ihojnicki

Therefore, what I call "magnification" in the original answer should be called "conversion factor" from points to pixels.


Original answer

By default under Windows Mathematica 13 uses hidden global magnification equal to 96/72:

SystemInformation["Devices", "ConnectedDisplays"]

screeenshot

On my system the display scale is set to 100% under the "Display" in the Windows "Settings" application, and your code returns Ceiling[size*96/72.]:

Plot[x, {x, 0, 1}, PlotRange -> {{0, 1}, {0, 1}}, Axes -> False, AspectRatio -> Automatic,
   ImageSize -> 1000] // ImageDimensions
{1334, 1334}
Table[Ceiling[size*96/72.], {size, {100, 1000, 10000}}]
{134, 1334, 13334}

Probably your display scale is set to 125%, and hence you get the value Ceiling[size*1.25*96/72.]:

Table[Ceiling[size*1.25*96/72.], {size, {100, 1000, 10000}}]
{167, 1667, 16667}

See also this answer of mine for additional information:

$\endgroup$
3
  • $\begingroup$ Thank you for fast answer! $\endgroup$
    – imida k
    Commented Jul 10, 2022 at 14:43
  • $\begingroup$ @imidak You are welcome! $\endgroup$ Commented Jul 10, 2022 at 14:44
  • 3
    $\begingroup$ It’s not really magnification. It’s just how you convert points into pixels. They are different units after all. $\endgroup$
    – ihojnicki
    Commented Jul 10, 2022 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.