PaperSize In Normalized PaperUnits

I am attempting to dynamically set the paper size based on the size of the data I have in a matrix. For example, if I had data that was 512×1024, I would want the paper size to be 1:2 relative to some unit (say an inch). In order to accomplish this generically, I want to use normalized paper units, like so:

>> set(gcf, 'PaperUnits' , 'Inches')
>> get(gcf, 'PaperSize')
ans =
8.5000 11.0000
>> set(gcf, 'PaperSize', [1, 1])
>> get(gcf, 'PaperSize')
ans =
1 1
>> set(gcf, 'PaperUnits', 'Normalized')
>> set(gcf, 'PaperSize', [0.5, 1])
>> set(gcf, 'PaperUnits', 'Inches')
>> get(gcf, 'PaperSize')
ans =
10.0000 11.2500
Member Asked on June 4, 2020 in Matlab.
Add Comment
  • 1 Answer(s)
    set(gcf, 'PaperUnits', 'Inches')
    
    set(gcf, 'PaperSize', [0.5, 1]*InchesPerUnit)
    
    get(gcf, 'PaperSize')
    
    Guru Answered on June 4, 2020.
    Add Comment

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.