sbte / fix_matlab_eps Goto Github PK
View Code? Open in Web Editor NEWScript to fix artifacts in EPS files generated from Matlab contour plots
License: GNU General Public License v3.0
Script to fix artifacts in EPS files generated from Matlab contour plots
License: GNU General Public License v3.0
There are still white lines in the red part of the figure. I don't see this in evince 3.10.3.
Thanks for supporting python 3!
When trying on a flattened ribbon()
figure, I get the following result:
The following ribbons.zip contains the ribbons.fig
to reproduce the image above.
I have Inkscape 0.91 r13725 (Jan 30 2015) and Ghostscript 9.19, but I get the following error if I try to open t with Ghostscript:
Error: /typecheck in --moveto--
Operand stack:
--nostringval--
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-
- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- fa
lse 1 %stopped_push 1967 1 3 %oparray_pop 1966 1 3 %oparray_
pop --nostringval-- 1950 1 3 %oparray_pop 1836 1 3 %oparray_po
p --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringv
al-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1194/1684(ro)(G)-- --dict:2/20(G)-- --dict:82/200(L)-- --dict:33
/50(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 131017
MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1
The script does work on the example you provide!
Hey. First off, thanks for creating this script. I've been able to use it (mostly) successfully. However it has been struggling with the following eps (in.eps), as the colorbar colors and numbers are gone after running the script on it (out.eps).
Also as a side note. When first running your script on this particular eps, I was getting this Inkscape error
** (inkscape.exe:3220): WARNING **: EPS cannot have its bounding box extend beyond its content, so if your drawing is smaller than the page, --export-area-page will clip it to drawing.
Presumably because this eps is actually larger than its page. Modifying line 23 in your code to
ret = subprocess.call('inkscape --export-area-drawing --export-eps=' + tmp+' '+sys.argv[1], shell=True)
fixed it.
Cheers
Add support for python 3.
Reported by @hk66 in altmany/export_fig#44
@Sbte Thanks for your code. I wanted to use your python code for an .eps file which has not been generated by matlab(attached here). I have this error:
"Traceback (most recent call last):
File "fix_matlab_eps.py", line 121, in
main()
File "fix_matlab_eps.py", line 56, in main
up_to_m = last[0].split('m')[0]
IndexError: list index out of range"
Could you please check it?
test.eps.zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.