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

 
 

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

Submitter:  Bryan Usevitch <beuwinkle>
Submitted:  Tue 12 Oct 2010 07:53:29 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.2.3 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by beuwinkle (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
    2010-10-14 bpabbott Open/ClosedOpen Closed
    2010-10-13 bpabbott StatusNone Fixed
    2010-10-12 beuwinkle Attached File- Added mkpca.m, #21666

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code