Search code examples
octave

How to display an image in Octave with original aspect ratio and size?


I want to display an image in octave without being scaled (i.e. one image pixel maps to exactly one pixel of my monitor) or having a wrong aspect ratio. Unfortunately neither imshow(), imagesc() or image() do that automatically. But it must be possible, right?
I'm using Octave 3.2.4.


Solution

  • There's a couple ways to do this. Here's 2 of them:

    1. run daspect ([1 1]) after displaying the image;
    2. use set to change some properties of the image set (gca, "Position", [0 0 1 1])