octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: color "none" for figures


From: Thorsten Meyer
Subject: Re: color "none" for figures
Date: Tue, 16 Mar 2010 22:04:22 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Thorsten Meyer wrote:
> David Bateman wrote:
>> Thorsten Meyer wrote:
>>> Hi,
>>>
>>> attached is a little patch, which allows a value of "none" for the
>>> "color"
>>> property of a figure.
>>> Example:
>>> plot(1,1)
>>> set(gcf, "color", [1 0 0]); # yellow background
>>> set(gcf, "color", "none");  # transparent background
>>>   
>> This should also be done for the axes as the axes and figures are
>> treated separately. Shouldn't "none" be the default color for the
>> figure and axes?
> For axes, there already is a color value "none" and it leads to
> transparent axes (which is particularly useful, when plotting two axes
> on top of each other).
> 
> Before the changes in 1e38d9ed1e28 (and related), no color was drawn for
> axes and figure in the gnuplot backend which is equivalent to "none".
> 
> I would also be happy with "none" as default. Only the matlab default
> happens to be light gray for the figure background and white for axes.
> 

To recap:
 - At the moment white is the default figure background (color [1 1 1]).
 - By the gnuplot backend this white background is drawn as an additional white
rectangle (which has a black boundary around it for some reason).
 - The patch I proposed will allow one to remove this white rectangle by setting
        set(gcf, "color", "none")
 - The fltk backend does not know yet how to deal with color "none". It will
ignore it as far as I can see.
 - Apparently, there are different opinions on the default background colors for
plots in octave

Today I learned another reason why I want to be able to get rid of the
background color: in postscript files generated with print xxx.ps, the
additional rectangle for the figure background color will enlarge the bounding
box to the paper size which can be quite annoying...

As to the defaults: I'd say either
 - color defaults as in matlab (white axes on gray figure background)
or
 - color "none" to interfere with the backend as little as possible

Ben reported that matlab has different defaults for plots on screen and printed
output. As long as this is not possible in octave, I would vote for color "none"
(both figure and axes).

Anyway, I would like to ask: Is it ok to push the proposed patch? I would also
like to make color "none" equivalent to color white for the fltk backend, but I
have no idea where to look in the code (can somebody with more insight give me a
hint?).

regards

Thorsten
# HG changeset patch
# User Thorsten Meyer <address@hidden>
# Date 1268773138 -3600

diff -r d2ac9433cd09 src/ChangeLog
--- a/src/ChangeLog     Mon Mar 15 16:56:14 2010 -0400
+++ b/src/ChangeLog     Tue Mar 16 21:58:58 2010 +0100
@@ -0,0 +1,5 @@
+2010-03-16  Thorsten Meyer  <address@hidden>
+
+       * graphics.h.in (base_graphics_object): Allow value "none" for
+       figure color.
+
diff -r d2ac9433cd09 src/graphics.h.in
--- a/src/graphics.h.in Mon Mar 15 16:56:14 2010 -0400
+++ b/src/graphics.h.in Tue Mar 16 21:58:58 2010 +0100
@@ -2568,7 +2568,7 @@
       handle_property currentaxes S , graphics_handle ()
       array_property colormap , jet_colormap ()
       radio_property paperorientation , "{portrait}|landscape|rotated"
-      color_property color , color_values (1, 1, 1)
+      color_property color , color_property (color_values (1, 1, 1), 
radio_values ("none"))
       array_property alphamap , Matrix (64, 1, 1)
       string_property currentcharacter r , ""
       handle_property currentobject r , graphics_handle ()

reply via email to

[Prev in Thread] Current Thread [Next in Thread]