Git Product home page Git Product logo

Comments (1)

jbmouret avatar jbmouret commented on July 20, 2024

Hi

First, note that you can use LaTeX for text rendering in matplotlib. You can even add a preamble:
rc('text', usetex=True)
matplotlib.rcParams['text.latex.preamble'] = ['\usepackage{siunitx}']

I suppose you can put all your document-specific settings in a package and rely on \usepackage{your_settings} to use them.

Something closer to your example is to use the pgf backend, which generates pgf commands that can be executed by latex.
See: http://matplotlib.org/users/pgf.html
''Using the pgf backend, matplotlib can export figures as pgf drawing commands that can be processed with pdflatex, xelatex or lualatex. XeLaTeX and LuaLaTeX have full unicode support and can use any font that is installed in the operating system, making use of advanced typographic features of OpenType, AAT and Graphite. Pgf pictures created by plt.savefig('figure.pgf') can be embedded as raw commands in LaTeX documents"

It also seems (I never tried) that you can embed python code into latex:
http://tex.stackexchange.com/questions/121877/embedding-python-in-latex-hello-example

Putting everything together: I believe it's possible to do something similar to what you do with gnuplot, but I never tried. If you manage to do it, don't hesitate to do a pull request and I will include your contribution in the tutorial.

from matplotlib_for_papers.

Related Issues (7)

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.