Code Monkey home page Code Monkey logo

properfigsize's Introduction

properfigsize

Use the proper figure size for your matplotlib plots that you embed in a PDF with pdflatex. Finally no more stupid font size scaling after you created all your plots and compile you PDF.

Usage

Look at the example in the examples folder. Let's say you want to create a PDF with 2 plots. One of them is going to be one column wide in your two column document, the other plot will be two columns wide. You know the aspect ratios your plots should have, but not the final sizes in your document. With properfigsize you can use a placeholder figsize which will be set to the correct size, after running your plotting script twice. It's important that you use tight_layout=True when creating your matplotlib figure.

Installation

pip install git+https://github.com/ap--/properfigsize.git

Run the example

You need pdflatex and matplotlib. To see the resulting document.pdf file, run:

python example.py  # first pass
python example.py  # second pass, figures now have the correct size
pdflatex document.tex

properfigsize's People

Contributors

ap-- avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.