bugGNU Octave - Bugs: bug #63624, "XTick" no longer...

 
 

bug #63624: "XTick" no longer updated after "axis tight"

Submitter:  Sébastien Villemot <svillemot>
Submitted:  Fri 06 Jan 2023 05:29:44 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 8.0.90 Operating System:  * Any
Fixed Release:  8.1.0 Planned Release:  8.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 21 Jan 2023 01:09:17 PM UTC, comment #4: 

Thank you. That has fixed it for me.

I pushed an additional change with a BIST here to help avoid accidental regressions in the future:
https://hg.savannah.gnu.org/hgweb/octave/rev/63de4cc96c5d

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Thu 19 Jan 2023 10:14:30 PM UTC, comment #3: 

The limits are chosen in axes::properties::calc_ticks_and_lims as follows:


tick_sep = calc_tick_sep (lo, hi);
double i1 = std::floor (lo / tick_sep);
double i2 = std::ceil (hi / tick_sep);


so I am confident there cannot be more than one tick neither before the first data point nor after the last one.

I pushed the patch to stable (since this is a regression) here:

https://hg.savannah.gnu.org/hgweb/octave/rev/084bbdabb969

Pantxo Diribarne <pantxo>
Group Member
Mon 16 Jan 2023 05:07:55 PM UTC, comment #2: 

Is it ever possible that more than one tick would need to be removed from each side? (I can't currently think of a case where that would be necessary.)

If there are no such cases, your change looks good to me.

Markus Mützel <mmuetzel>
Group administrator
Sun 08 Jan 2023 02:17:54 PM UTC, comment #1: 

I can confirm the issue. I attached a patch that fixes the regression for me.

(file #54203)

Pantxo Diribarne <pantxo>
Group Member
Fri 06 Jan 2023 05:29:44 PM UTC, original submission:  

On Octave 8.0.1 (hg ID 9f4637377e33), one gets the following:


octave:1> plot(1:201)
octave:2> axis tight
octave:3> get(gca, 'XTick')
ans =

     0    50   100   150   200   250


Note that "XTick" still includes 0 and 250 (despite the fact that the plot window is correctly updated, i.e. its X-axis goes from 1 to 201).

This is a regression since on Octave 7.3.0 (and MATLAB R2022b), one gets:

octave:3> get(gca, 'XTick')
ans =

    50   100   150   200


Sébastien Villemot <svillemot>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #54203:  bug63624.patch added by pantxo (1006B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by svillemot (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-02-08 rik5 Open/ClosedOpen Closed
    2023-01-21 mmuetzel StatusReady For Test Fixed
        Fixed ReleaseNone 8.1.0
    2023-01-19 pantxo StatusPatch Submitted Ready For Test
    2023-01-16 mmuetzel Planned ReleaseNone 8.1.0
    2023-01-08 pantxo Attached File- Added bug63624.patch, #54203
        StatusNone Patch Submitted

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code