Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6563717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:52:56+00:00 2026-05-25T13:52:56+00:00

I cannot achieve to plot a square in Octave. I cannot force equally scaled

  • 0

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

enter image description here

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:

  1. I have Octave 3.2.4 on Windows XP.
  2. The suggestion in Stackoverflow
    does not work.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:52:56+00:00Added an answer on May 25, 2026 at 1:52 pm

    I believe this is an issue with Gnuplot’s windows output device. Compare it against the wxt device:

    Gnuplot 4.4.3, WinXP

    # Gnuplot, wxWidgets terminal
    set terminal wxt size 200,400
    set size ratio -1        # set size square
    plot x
    
    # Gnuplot, Windows terminal
    set terminal windows size 200,400
    set size ratio -1        # set size square
    plot x
    

    gnuplot_wxWidgets_terminal
    gnuplot_Windows_terminal

    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:

    # Octave, backend=Gnuplot, terminal=wxt/windows
    graphics_toolkit gnuplot     # backend gnuplot
    setenv('GNUTERM','wx')       # wx/windows
    figure, set(gcf,'position',[100 100 200 400])
    plot(-10:10, -10:10, 'r'), legend('x')
    axis([-10 10 -10 10])
    axis equal                   # axis square
    

    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 call refresh command to replot:

    octave_gnuplot_wx_resized
    octave_gnuplot_windows_resized

    The good news is that once you correctly set the figure size, axis equal is 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:

    # Octave, backend=FLTK
    graphics_toolkit fltk        # backend fltk
    figure, set(gcf,'position',[100 100 200 400])
    plot(-10:10, -10:10, 'r'), legend('x')
    axis([-10 10 -10 10])
    axis equal
    

    octave_fltk


    MATLAB

    For reference, here is the MATLAB output:

    %# MATLAB
    figure, set(gcf,'position',[100 100 200 400])
    plot(-10:10, -10:10, 'r'), legend('x')
    axis equal
    axis([-10 10 -10 10])
    

    matlab

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cannot seem to compile mod_dontdothat on Windows. Has anybody managed to achieve this?
I am trying to achieve the following: I have a single ORDER BY statement
What does AtomicBoolean do that a volatile boolean cannot achieve?
Hi I'm developing a .Net application and I want to achieve the following: I
How do I achieve the following in CMake (using version 2.8.5)? I have documentation
I am trying to achieve html similar to following with MVC3 + Razor: <input
Cannot dump Stack Overflow XML file into SQL Server 2008. Could you please explain
Cannot find any example on Google.
I cannot figure out how to change the title bar icon (the icon in
I cannot understand the Oracle documentation. :-( Does anybody know how to fetch multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.