Thu 21 Jun 2012 10:27:37 PM UTC, comment #9:
I pushed the change below.
http://hg.savannah.gnu.org/hgweb/octave/rev/fce841c941a5
|
Thu 21 Jun 2012 08:10:34 PM UTC, comment #8:
For transparency, you can set the axes "color" to "none"
set (gca (), "color", "none")
If you prefer transparency all the time, you can get that by changing the default.
set (0, "defaultaxescolor", "none")
If you place that line in your ~/.octaverc file, the background of your plots will remain transparent the next time you run octave as well.
|
Thu 21 Jun 2012 08:05:21 PM UTC, comment #7:
Ben,
Forgive my lack of understanding but would your latest patch force the background to be white instead of leaving it transparent? If so, that's not what I intended.
|
Thu 21 Jun 2012 06:43:13 PM UTC, comment #6:
Ben,
That should work, and is at least consistent since we will be setting the same default in both places.
|
Thu 21 Jun 2012 05:45:14 PM UTC, comment #5:
RIk,
Thanks for the comments. I gave up trying to follow how Octave handes defaults. I'm leaning toward a slightly different patch.
I ran some tests, and all seems to work the same as ML.
|
Thu 21 Jun 2012 05:39:56 PM UTC, comment #4:
The whole application of default properties to graphics objects is somewhat screwed up. Long term, I think it will have to be re-coded. In the short term, I think your patch is probably okay. In C++, objects like axes can be instantiated with default properties. The default properties for axes are in graphics-props.cc where the default is white ([1 1 1]). Why we have a separate routine, _go_axes_init_, which is only called from newplot.m I don't know.
The worst part is the defaults don't seem to agree. There is the obvious mismatch for 'color', but if you look at axes::properties::factory_defaults (void) in graphics-props.cc it has defaults for things which are not initialized by _go_axes_init_ such as 'xminortick'. Maybe this is correct, I don't know.
But your patch is probably safe for this particular issue.
|
Thu 21 Jun 2012 12:45:12 AM UTC, comment #3:
Ok thanks for the tip.
The code below indicates that the built-in _go_axes_init_() is setting the "color" property (background axes color) to "none".
I've attached a trivial patch. I'm not sure this is the proper fix, so I'll give myself time to study the code before committing it.
(file #26074)
|
Thu 21 Jun 2012 12:05:28 AM UTC, comment #2:
By platform, personally confirmed to work:
Mac OS X
*The file icons clearly show the transparent vs white backgrounds
*In Preview, select View>Document Background
Windows
*Drag into PowerPoint set the slide design to a dark background or place over text
*Open in Inkscape and add a layer below the default layer then draw something on that bottom layer
Both
*Open in Photoshop (interestingly, gnuplot-generated EPS files fail to open in Photoshop)
There may be other ways (Gimp, OpenOffice Draw, OpenOffice Impress) but I haven't tried them so I cannot confirm that they would work.
|
Wed 20 Jun 2012 10:37:07 PM UTC, comment #1:
I see the same result in each case.
What did you do to determine the back ground was different for the two plots ?
|
Wed 20 Jun 2012 05:10:51 AM UTC, original submission:
When using the hold function, the background of a plot is altered. The following test case illustrates this.
The file "without_hold.eps" will have a transparent background and "with_hold.eps" will have a white background.
I have tested this on two systems, both with Octave 3.6.2:
Mac OS X 10.7.4 using fltk and gnuplot (x11 and aqua)
Windows XP SP3 using fltk and gnuplot
|