I cannot achieve to plot a square in Octave.
I cannot force equally scaled axes, so I am getting a rectangle instead:

The following trials are not working:
x = [0, 1, 1, 0, 0]';
y = [0, 0, 1, 1, 0];
plot(x, y), axis equal, axis([-1,2, -1,2])
% figure('Position', [10,10,100,100]); %[startx,starty,width,height]
% plot(x, y)
Probably I would need to specify a fixed window size and equally
scaled axes. I would be satisfied, when the first such display window
would show a correct square. A luxury solution would make the window
(or its content)
not interactively resizable.
Remarks:
- I have Octave 3.2.4 on Windows XP.
- The suggestion in Stackoverflow
does not work.
I believe this is an issue with Gnuplot’s
windowsoutput device. Compare it against thewxtdevice:Gnuplot 4.4.3, WinXP
Note that for the “win terminal”, size affects the figure size including window title bar and status bar, while for the “wx terminal” it only sets the inner drawing area
Octave 3.4.2, WinXP
Unfortunately, when I tried this in Octave, it still was not what it should be for both terminal types. In fact, the problem is that resizing the figure using
set(gcf,'position',[..])had no effect:Therefore, I had to manually resize the figures using the mouse to the specified size
(200,400)(yes, I actually pulled a virtual ruler and measured the pixels!). Finally callrefreshcommand to replot:The good news is that once you correctly set the figure size,
axis equalis working for both terminals types.On the other hand, the new FLTK backend is behaving correctly without any hacks, so you might wanna switch to it:
MATLAB
For reference, here is the MATLAB output: