bugGNU Octave - Bugs: bug #52412, Manual axes ticks should emit...


bug #52412: Manual axes ticks should emit error if values are not increasing

Submitted by:  Markus Mützel <mmuetzel>
Submitted on:  Wed 15 Nov 2017 10:11:10 AM UTC
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Patch Submitted Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


( Jump to the original submission )

Tue 21 Nov 2017 12:49:39 PM UTC, comment #6: 

The attached patch adds a new type of "special_constraints" to graphics properties (only row vector properties for now). I don't really like the name. But it pretty much describes what it can be used for: Adding constraints to properties that need "some special" check.
For now it adds the constraint "ENFORCE_ASCENDING" to the [xyz]tick and [xyz]lim properties of axes.
It can also be used to add other constraints in the future: e.g. the "position" (and related) properties should allow only non-negative values in the third and fourth element while there should be no such limitation on the first and second element...

I am not sure whether it makes sense to also integrate the (mutually exclusive) "finite_constraints" into these new (accumulative) "special_constraints".

I didn't find any properties that must be strictly decreasing. I just added that case to check whether the enumeration works as expected. If you think it is better to remove that case from the patch, I don't mind at all.

(file #42451)

Markus Mützel <mmuetzel>
Project Member
Wed 15 Nov 2017 11:22:51 PM UTC, comment #5: 

Rik: Seems right to me.

Michael Godfrey <godfrey>
Project Member
Wed 15 Nov 2017 06:53:24 PM UTC, comment #4: 

I also think it is reasonable to expect increasing values.  I think that this catches a common case where a user mistypes or otherwise accidentally specifies a strange sequence of values.

If they really do have a strange sequence, it isn't a burden for them to sort those before passing to the plotting code.

Rik <rik5>
Project Administrator
Wed 15 Nov 2017 04:23:50 PM UTC, comment #3: 

Just to be clear, I meant that the sort (Axes)
could go into the set (...) code for axis setting..

Michael Godfrey <godfrey>
Project Member
Wed 15 Nov 2017 10:32:17 AM UTC, comment #2: 

Yes, I think it is reasonable to expect ticks to be increasing values.

Pantxo Diribarne <pantxo>
Project Member
Wed 15 Nov 2017 10:30:51 AM UTC, comment #1: 

Seems pretty simple to just do a sort() on the
Axes vector. If there is a problem with this, then
Matlab "compatibility" should be the choice.

Michael Godfrey <godfrey>
Project Member
Wed 15 Nov 2017 10:11:10 AM UTC, original submission:  

When setting manual axis ticks, Octave allows them in any order. Matlab throws the following error if they are not ascending:

set(gca, 'ytick', [10 3 1 0.3 0.1], 'ylim', [0.02 17], 'yminorgrid', 'on')
Error using matlab.graphics.axis.Axes/set
While setting the 'YTick' property of 'Axes':
Value must be a vector of type single or double whose values increase

While that could be a nice extension to the Matlab syntax, it might lead to unexpected behavior: e.g. the minor grid lines outside the major tick range are not shown (see bug #52376). There might be also other side effects.

Should we follow Matlab here and force the manual ticks to being in ascending order?

Markus Mützel <mmuetzel>
Project Member


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

Attach Files:

Attached Files
file #42451:  bug52412_graphics_ascending_order.patch added by mmuetzel (9KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by mmuetzel (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 project members can vote.





    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-21 mmuetzel StatusConfirmed => Patch Submitted
    2017-11-21 mmuetzel Attached File- => Added bug52412_graphics_ascending_order.patch, #42451
    2017-11-15 rik5 StatusNone => Confirmed
        SummaryManual axes ticks should be increasing => Manual axes ticks should emit error if values are not increasing

    Back to the top

    Powered by Savane 3.9