Questions
- How do I change the line thickness in Matlab postscript figures
- The axes labels are clipped in my Matlab figure, how do I fix it?
- My postscript MS Excel chart doesn’t display properly
- What software can I use to edit postscript figures?
Answer
How do I change the line thickness in Matlab postscript figures
Matlab will generate postscript files that can be easily edited. Search the file for the /SO /DO
definitions and replace the lines with this:
/SO { [] 0 setdash } bdef
/DO { [2 dpi2point mul 3 dpi2point mul] 0 setdash } bdef
/DA { [6 dpi2point mul] 0 setdash } bdef
/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
This will change the line styles so that they are easier to see when the figure is reduced in size for journal papers.
The axes labels are clipped in my Matlab figure, how do I fix it?
Edit the postscript file and find the string
%%PageBoundingBox:
and change the coordinates llx lly urx ury
, where ll
is lower left corner and ur
is upper right corner. To determine the coordinates, use ghostview with the bounding box markers turned on. Also look for the lines something like:
portraitMode 0432 7344 csm
0 28 6894 5156 MR c np
85 dict begin %Colortable dictionary
/c0 { 0 0 0 sr} bdef
/c1 { 1 1 1 sr} bdef
and change the 4 numbers before the MR
. The c
character was defined earlier as
% operator abbreviations
/c /clip ldef
so the figure is clipped at the coordinates before the MR
. The format for the coordinate is ulx uly lrx lry
, where ul
is upper left and lr
is lower right.
My postscript MS Excel chart doesn’t display properly
To generate postscript output from Excel, you normally print the chart to a file using a postscript printer driver. After you have set the page bounding boxes to enclose the figure, remove all occurrences of “setpagedevice
“.
What software can I use to edit postscript figures?
The popular programs are Corel Draw and Adobe Illustrator. However my experience has been that when a file is imported into those programs and then exported again, the file size is usually 10x the original size!
The only software I have used that handles editing of postscript figures relatively well is Mayura Draw, inexpensive shareware software that only doubles the file size of the original.