bugGNU Octave - Bugs: bug #37715, colormap opens image if there's...

 
 

bug #37715: colormap opens image if there's none

Submitter:  Carnë Draug <carandraug>
Submitted:  Mon 12 Nov 2012 05:19:00 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 03 Dec 2012 06:54:34 PM UTC, comment #8: 

Yes, when I asked first I did not knew the matlab behaviour. I can imagine users running only colormap and then expecting other commands that require an open figure to work.

And I can close bugs now too :D

Carnë Draug <carandraug>
Group Member
Mon 03 Dec 2012 06:32:53 PM UTC, comment #7: 

Yes, I know it is weird, but I think we should keep compatibility and close the bug report.

John W. Eaton <jwe>
Group administrator
Mon 03 Dec 2012 04:35:56 PM UTC, comment #6: 

According to folks on ##matlab, colormap does open a figure when called with no arguments.  Should we just acknowledge that Matlab is weird and close this bug?  Otherwise we will break compatibility. 

Rik <rik5>
Group administrator
Fri 30 Nov 2012 04:53:08 PM UTC, comment #5: 


> I do not know why the code and everything after it doesn't show up...


Your closing tag was -verbatim instead of -verbatim-. Savannah is not very forgiving of errors with its markup.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Fri 30 Nov 2012 04:27:32 AM UTC, comment #4: 

I do not know why the code and everything after it doesn't show up...

I can workaround this by checking if there's a figure open but in case there is not, I need a way to get the default colormap. Should I hardcode "jet (64)"? Doesn't sound good idea.


if (! isempty (get (0, "CurrentFigure")))
  cmap = colormap ();
else
  ## how do we get default colormap?
endif


Carnë Draug <carandraug>
Group Member
Fri 30 Nov 2012 04:23:16 AM UTC, comment #3: 

hmm... is there a way to get the default colormap then? I can workarond with the following but need a way to get the default:


if (!isempty (get (0, "CurrentFigure")))
  cmap = colormap ();
else
  ## how do we get the default colormap??
endif
-verbatim

But in that case, how can I return the default colormap? Should I hard code jet(64)?

Carnë Draug <carandraug>
Group Member
Tue 13 Nov 2012 12:04:08 AM UTC, comment #2: 

Does matlab opens one even when there's 1 output argument? Because it would appear to me like a bug on their side. And even if it's by design, what purpose can an empty figure have to cause someone to co,plain?

Could the figure be created and kept invisible. I don't know much about figure properties but seems that there is a way to make it invisble. Is there a way to do this so that the figure does exist but no window porps up? And is this visibility automatically switched on once someone tries to draw something or would it cause any problem?

Carnë Draug <carandraug>
Group Member
Mon 12 Nov 2012 09:41:21 PM UTC, comment #1: 

Matlab appears to behave the same way, so if we change it, then I expect that we would get bug reports saying that we are incompatible with Matlab.

John W. Eaton <jwe>
Group administrator
Mon 12 Nov 2012 05:19:00 AM UTC, original submission:  

When colormap() is called without any argument, should return the current colormap.

However, if there's no figure open, it will create one to return its colormap since it does it with gcf() on line 95


    cmap = get (gcf (), "colormap");


Is there a way to avoid this? It's a bit annoying also since other functions such as ind2gray and ind2rgb use it as default which causes a figure window to open none is expected.

Carnë Draug <carandraug>
Group Member

 

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

Attach Files:
   
   
Comment:
   

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 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jordigh (Updated the item)
  • -email is unavailable- added by carandraug (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-12-03 carandraug StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2012-11-12 jordigh StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code