hsadok / pubplot Goto Github PK
View Code? Open in Web Editor NEWSeamless LaTeX and Matplotlib integration for publication plots.
License: ISC License
Seamless LaTeX and Matplotlib integration for publication plots.
License: ISC License
Hi Hugo,
Thank you again for putting this on GitHub; I appreciate the work and thought you've put into this framework. I'm working with IEEEtran.cls as well, and can get figures to work perfectly with the following bug fixes / improvements:
pubplot.Document()
is somewhat confusing. I think I understand why you opted for documentclass
instead of document_class
, to mirror LaTeX; but in that case, I would recommend something like pubplot.Document({'documentclass': '[journal]IEEEtran'})
rather than having two separate fields (so that this option is specified as it would be in the LaTeX document).\usepackage{times}
, which pubplot does not currently support. I recommend adding an argument like: pubplot.Document({'documentclass': '[journal]IEEEtran', 'packages': ['times']})
. Or, to be more flexible: pubplot.Document({'documentclass': '[journal]IEEEtran', 'preamble': [r'\usepackage{times}']})
.\footnotesize
, not \small
. You have \small
hardcoded rather than detected for most figure font sizes, so I believe this is the discrepancy.pubplot.Document({...}, style={'font.size': '8'}
, and override all font settings with the specified font.size
key. If the user of your library is wanting to override this value, they probably want it to be the default for everything, and could then manually specify xtick.labelsize
for instance. Adding this would make the previous issue less of a bother.Document.figure()
method which takes a GridSpec for the axes rather than always using subplots ([GridSpec](https://matplotlib.org/users/gridspec.html; or perhaps better, using fig.add_gridspec and fig.add_subplot). What I would recommend is having Document.figure()
return a figure object without creating any axes, and then hook into Figure.add_gridspec
and Figure.add_subplot
like the second link.tight_layout
is wrong, leading to font sizes not matching the document. Currently, pubplot
does Figure(..., tight_layout=True)
in document.py
and later canvas.print_figure(..., bbox_inches='tight')
in figure.py
. To get the spacing / sizing right, these need to be Figure(..., tight_layout={'pad': 0})
and canvas.print_figure(..., bbox_inches='tight', pad_inches=0)
respectively.Since you've already put a bit of time into this project, I'll go ahead and make a pull request with everything except the figure caption size detection for IEEEtran. We can have a dialog there.
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.