bugGNU Octave - Bugs: bug #50680, Better documentation of newplot,...


bug #50680: Better documentation of newplot, axes, and plot creating in general

Submitter:  Francesco Potortì <pot>
Submitted:  Thu 30 Mar 2017 01:47:21 PM UTC
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Mon 03 Apr 2017 03:37:24 PM UTC, comment #4: 

Changed the title to try and capture the notes from comment #3.

Rik <rik5>
Group administrator
Fri 31 Mar 2017 03:34:09 PM UTC, comment #3: 

I don't think it is the colororder property documentation that has to be better improved; most properties are reset by newplot, not only this particular property.

We need to find a place to fully document the interaction between axes and high level plotting functions. Something like:

"Some properties of axes objects ("colororder" for example) have to be changed before any plot to be effective. On the other hand, unless "hold" has been used, high level plotting functions will reset axes properties (see newplot) before plotting. Basically there are two ways to deal with this case:

  • Create the axes, set its properties at your convenience and then use "hold on" to prevent newplot from resetting the axes properties. E.g:

axes ("colororder", jet (5), "box", "on");
hold ("on")
plot (rand (5,5))

  • Set properties as defaults. E.g:

figure ("defaultaxescolororder", jet (5))
axes ();
plot (rand (5,5))

Note also that most 2D high level plotting functions set the "box" axes property "on". In the first method we need to set "box" to "on" manually, otherwise the resulting plot will have its "box" "off" (the default)."

I think something like this covers much of this bug and bug #49400.

Pantxo Diribarne <pantxo>
Group Member
Thu 30 Mar 2017 08:17:34 PM UTC, comment #2: 

The report I mentioned is bug #49400.

Pantxo Diribarne <pantxo>
Group Member
Thu 30 Mar 2017 03:20:18 PM UTC, comment #1: 


This is all expected and compatible with ML (but probably insufficiently documented):

  • Example 1: "hold on" creates an axes which will be used for further high level plotting since it has its "nexplot" property set to "add" by "hold" function (see "help newplot")
  • Example 2: after "hold on" has created a first axes, you create a second one with "axes". The second one has "nexplot"->"replace" (the default) and will thus be reset by "newplot"
  • Example 3: you create a second axes that covers the first one, use "set (gca, 'colororder', jet);" instead of "axes (...)"

There is already a request to better document this behavior but I can't find it right now.

Pantxo Diribarne <pantxo>
Group Member
Thu 30 Mar 2017 01:47:21 PM UTC, original submission:  

This bug follows up on bug #50511.

In the answer to that bug, I discover that this code works:

> close; figure; hold on; set(gca,'colororder',jet);
> a=1:20; plot(a,a+a')

The first problem is that this is counterintuitive. I suggest that this code be added in the docs as an example, maybe following the text of the 'colororder' line property.

The second problem is that this code does not work:

> close; figure; hold on; axes('colororder',jet);
> a=1:20; plot(a,a+a')

Apparently, axes does nothing with the colororder property, yet does not give an error. This may be an axes bug or a documentation bug, I do not know.

Third, in the following instance axes() corrupts the plot in a strange way:

> close; a=1:20; plot(a,a+a');
> axes('colororder', jet);

the lines disappear after running axes(), and moreover the axis labels are corrupted.

All the above code is run under Octave 4.0.3 on Debian.

Francesco Potortì <pot>


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

Attach Files:

No files currently attached


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 pantxo (Posted a comment)
  • -email is unavailable- added by pot (Submitted the item)
  • -email is unavailable- added by pot (submitter of bug #)

    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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-03 rik5 SummaryBetter documentation of colororder property Better documentation of newplot, axes, and plot creating in general
    2017-03-30 rik5 CategoryPlotting with OpenGL Documentation
        StatusNone Confirmed
        SummaryStrange behaviour of colororder property Better documentation of colororder property
    2017-03-30 pantxo Release4.0.3 dev
    2017-03-30 pot Carbon-Copy- Added akramer

    Back to the top

    Powered by Savane 3.13-0159.
    Corresponding source code