Skip to content

TeXFigure renders matplotlib figure repr instead of texfigure.Figure.repr_figure #3

@wtbarnes

Description

@wtbarnes

Instead of the figure in the document, I get the matplotlib Figure repr, i.e. the memory address of the or what you get when you just print a Figure at the command line.

Version Info

Python: 3.6.4
TeXLive 2018
pythontex: 0.16
texfigure: master
matplotlib: 2.2.2

MWE

test_texfigure.tex

\documentclass{article}
\usepackage{pythontex}
\usepackage{graphicx}
\begin{document}
\begin{pycode}[manager]
import texfigure
manager = texfigure.Manager(pytex,'./')
\end{pycode}
\begin{pycode}[manager]
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.gca()
ax.plot([1,2],[3,4])
Fig = manager.save_figure('Fig', fig)
Fig.caption = 'This is the caption'
\end{pycode}
\py[manager]|Fig|
\end{document}

and the resulting document looks like this,
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions