bugGNU Octave - Bugs: bug #36690, Hold function alters eps background

 
 

bug #36690: Hold function alters eps background

Submitted by:  None
Submitted on:  Wed 20 Jun 2012 05:10:51 AM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: Ben Abbott <bpabbott>
Originator Name: Wayne MenzieOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

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

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
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.

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
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.

-Deleted Account- <beansbaxter>
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.

Rik <rik5>
Project Administrator
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.

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
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.

Rik <rik5>
Project Administrator
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)

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
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.

-Deleted Account- <beansbaxter>
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 ?

Ben Abbott <bpabbott>
Project MemberIn charge of this item.
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

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #26074:  changeset.patch added by bpabbott (712B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by beansbaxter (Posted a comment)
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 29 Jun 2012 05:19:45 PM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Thu 21 Jun 2012 10:27:37 PM UTCbpabbottStatusPatch Submitted=>Ready For Test
    Thu 21 Jun 2012 12:45:12 AM UTCbpabbottAttached File-=>Added changeset.patch, #26074
      StatusWorks For Me=>Patch Submitted
      Assigned toNone=>bpabbott
      Release3.6.2=>dev
      Operating SystemMac OS=>Any
    Wed 20 Jun 2012 10:37:07 PM UTCbpabbottStatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1