bugGNU Octave - Bugs: bug #31317, Plot attributes not saved when...

 
 

bug #31317: Plot attributes not saved when printing to .eps file

Submitted by:  Bryan Usevitch <beuwinkle>
Submitted on:  Tue 12 Oct 2010 07:53:29 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.2.3Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 13 Oct 2010 02:16:08 PM UTC, comment #2:

Ben,
Thanks for the quick reply. Also, for those that are currently stuck with the older versions of Octave, I found this work around.
Print to a postscript file, then run ps2eps on the postscript file. This preserves the font sizes, and it also corrects the bounding box problem

Bryan Usevitch <beuwinkle>
Wed 13 Oct 2010 12:47:20 AM UTC, comment #1:

This was a "feature" of gnuplot. Gnuplot halves the fontsize for eps files.

Recently, Octave has been modified to correct for that. Thus, this problem is fixed in the developer's sources.

Ben Abbott <bpabbott>
Project Member
Tue 12 Oct 2010 07:53:29 PM UTC, original submission:

Octave allows the fontsize to be changed on plots. However, when printing these plots to an eps file, the changed attributes are not saved. Experimentation found that when printing to a postscript file, the changed attributes were saved (see below for a reason why this didn't result in a good work around). Consider the following code:
fs = 18;
text(v(1,1)+2,v(2,1)+2.8,'y1','FontSize',fs)
text(v(1,2)+2.2,v(2,2)+3,'y2','FontSize',fs)
grid on
xlabel('x1','FontSize',fs);
ylabel('x2','Fontsize',fs);
set(gca,'Fontsize',fs)
print -dpsc test.ps
print -depsc2 test.eps

Viewing the test.eps file with gv showed that the fontsize was not saved as 18. However, viewing test.ps shows that the fontsize was indeed changed to 18.

Interestingly, the .ps output also gives a bounding box. So I used the following initially as a workaround:
print -dpsc test.eps
However, the problem is that the -dpsc does not give a tight bounding box (there was a lot of white space around the figure).

The attached file gives a full working example.

Bryan Usevitch <beuwinkle>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #21666:  mkpca.m added by beuwinkle (544B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by beuwinkle (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 14 Oct 2010 01:43:35 PM UTCbpabbottOpen/ClosedOpen=>Closed
    Wed 13 Oct 2010 12:47:20 AM UTCbpabbottStatusNone=>Fixed
    Tue 12 Oct 2010 07:53:29 PM UTCbeuwinkleAttached File-=>Added mkpca.m, #21666

    Back to the top


    Powered by Savane 3.1-cleanup1