Skip to content

Helper functions for using Matplotlib with Latex templates

Notifications You must be signed in to change notification settings

jerome-white/latex-figure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Latex Figure

A library that manages plot formatting when building figures in Matplotlib to be presented in Latex-backed publications.

Usage

Download and setup the environment:

$> git clone https://github.com/jerome-white/latex-figure
$> cd latex-figure
$> export PYTHONPATH=`pwd`

Example: ACM with PGF

This library was designed primarily for making clean figures for ACM publications.

  1. One of the best file types for ACM -- and most other -- Latex documents is PGF. A matplotlibrc file tailored to this situation is included in this repository:

    $> export MATPLOTLIBRC=`pwd`/matplotlibrc/pgf.rc
  2. Import the class type corresponding to the type of figure you want. An example from the ACM module:

    from ltxfig.acm import ConferenceColumnFigure
    
    panels = ConferenceColumnFigure()
  3. While ConferenceColumnFigure can be used with its defaults, it is sometimes handy to change the number of panels (size) or plot dimensions:

    from ltxfig import MatplotlibRatio, PlotSize
    
    size = PlotSize(3, 4) # three rows, four columns
    ratio = MatplotlibRatio(hscale=0.5) # reduce the height be half
    panels = ConferenceColumnFigure(size=size, ratio=ratio)

Issues

For now only ACM "sigconf" is supported.

About

Helper functions for using Matplotlib with Latex templates

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages