bugGNU Octave - Bugs: bug #62645, Colormap or ColorOrder not...

 
 

bug #62645: Colormap or ColorOrder not respected by `bar`

Submitter:  None
Submitted:  Fri 17 Jun 2022 08:03:50 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 05 Jul 2022 02:56:58 PM UTC, comment #5: 

Octave behavior is Matlab-compatible (in other words, colormap() after or before bar() does not change colors plot).  Marking as "Won't Fix" since we want to keep compatible behavior.

Rik <rik5>
Group administrator
Fri 17 Jun 2022 02:17:56 PM UTC, comment #4: 

Apparently this change was made for Matlab compatibility? https://hg.savannah.gnu.org/hgweb/octave/rev/8bb14f4979ca

Related bug discussion: bug #59589

Arun Giridhar <arungiridhar>
Group Member
Fri 17 Jun 2022 01:52:14 PM UTC, comment #3: 

I see why it worked for me earlier. I had been symlinked to Octave 6.4.0 for something else and that makes the graph properly. (Figure attached) When I removed the symlink and went to Octave 7.1.0 and Octave 8, I can reproduce the no-gray behavior. Sorry for the mixup.

Also, this qualifies as a regression since it worked in 6.4.0.




Arun Giridhar <arungiridhar>
Group Member
Fri 17 Jun 2022 09:46:33 AM UTC, comment #2: 

I can confirm that issue.
The bar plot uses the default colors instead of a gray color scheme.

There might be two separate issues causing this:
1. There is no listener to the colormap property for the bar plot. But the documentation of bar states:

> The default color for bars is taken from the axes’ "ColorOrder" property.

So setting the colormap might not be expected to work in the first place.

2. Even if that is changed in the reproducer, `bar` doesn't respect what is set for the `"ColorOrder"` property of its parent axes either:

hf = figure(); clf(hf);
hax = axes(hf, 'ColorOrder', gray(5));
bar (hax, rand(10,3));


The second issue might be caused by the usage of `newplot` in `__bar__` (line 225) which resets the default properties of the axes afaict.
Not sure what that is needed for. Maybe it should be conditional on something (e.g., whether `bar` is called with an `axes` handle argument or not). Or it might be possible to remove it unconditionally (and change the current axes instead).

What does Matlab do?

Markus Mützel <mmuetzel>
Group administrator
Fri 17 Jun 2022 08:24:06 AM UTC, comment #1: 

Works just fine for me. What were you expecting to see?

Arun Giridhar <arungiridhar>
Group Member
Fri 17 Jun 2022 08:03:50 AM UTC, original submission:  

Plot a bar plot with following command would not generate plot with gray scale.

bar (rand (10, 3));
colormap (gray(64));

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #53310:  gray_bar.png added by arungiridhar (7KiB - image/png)

 

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 mmuetzel (Posted a comment)
  • -email is unavailable- added by arungiridhar (Posted a comment)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2022-07-05 rik5 Item GroupIncorrect Result Matlab Compatibility
        StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2022-06-17 arungiridhar Attached File- Added gray_bar.png, #53310
    2022-06-17 mmuetzel StatusWorks For Me Confirmed
        Release7.1.0 dev
        Operating SystemGNU/Linux Any
        SummaryColormap not work Colormap or ColorOrder not respected by `bar`
    2022-06-17 arungiridhar StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code