octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55574] axis equal truncates upper and lower p


From: Rik
Subject: [Octave-bug-tracker] [bug #55574] axis equal truncates upper and lower parts of picture
Date: Thu, 31 Jan 2019 13:29:40 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Update of bug #55574 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #3:

I think the axis.m script needs to be updated to rely more on the C++ graphics
properties to do it's job.  According to Matlab, using 'axis equal' should do
the following


Sets DataAspectRatio to [1 1 1], sets PlotBoxAspectRatio to [3 4 4], and sets
the associated mode properties to manual. Disables the “stretch-to-fill”
behavior.


The code in axis.m, however, is wildly complicated.


      elseif (strcmp (opt, "equal"))
        ## Get position of axis in pixels
        ca_units = get (ca, "units");
        set (ca, "units", "pixels");
        axis_pos = get (ca, "position");
        set (ca, "units", ca_units);

        pbar = get (ca, "plotboxaspectratio");
        dx = diff (__get_tight_lims__ (ca, "x"));
        dy = diff (__get_tight_lims__ (ca, "y"));
        dz = diff (__get_tight_lims__ (ca, "z"));
        new_pbar = [dx dy dz];
        new_pbar(new_pbar == 0) = 1;
        if (dx/pbar(1) < dy/pbar(2))
          set (ca, "xlimmode", "auto");
          new_pbar(1) = (dy / axis_pos(4)) * axis_pos(3);
        else
          set (ca, "ylimmode", "auto");
          new_pbar(2) = (dx / axis_pos(3)) * axis_pos(4);
        endif
        set (ca, "dataaspectratio", [1, 1, 1],
                 "plotboxaspectratio", new_pbar);


Changes should go on the development branch at this point.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55574>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]