Fix dashed and dotted lines in EPS export
by Daniel
30 Jul 2007
(Updated 01 Aug 2007)
No BSD License
EPS of dashed and dotted lines export badly. This modifies the EPS file to fix them.
Download Now
|
Watch this File
|
| File Information |
| Description |
I was very frustrated at not being able to export dashed and dotted lines in EPS format, as they come out weird. Finally I found a post somewhere on the internet that suggested editing a certain part of the EPS file to fix it. This is a function which, given the name of the EPS file, will modify the length of the 'dot', making it look better in the image.
I've found it useful to automatically add this function to my standard 'save figure' script, so it is always run.
In EPS file:
/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
It seems the optimal numbers to go in the EPS file depend on the thickness of the line being drawn. This code changes only the .5 which corresponds to the length of the 'dot'. The number 4 controls the space between the dots. Setting both equal to 1 seems to work well with a Matlab line thickness of 1.5. |
| Acknowledgements |
This submission has inspired the following:
export_fig
|
| MATLAB release |
MATLAB 7.4 (R2007a)
|
| Other requirements |
Should work on all platforms, but only tested on a mac. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (5) |
| 09 Apr 2008 |
Ronco Badsmith
|
|
|
| 26 Apr 2008 |
Rich Germuska
|
|
|
| 05 Jul 2008 |
Klaas van 't Veld
|
|
|
| 12 Dec 2008 |
Oliver Woodford
|
|
|
| 10 Apr 2009 |
Oliver Woodford
|
|
|
| Updates |
| 01 Aug 2007 |
Additional comment... |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com