Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
It appears that when there is a path outside the plotting limits then not all the path coordinates get plotted. When I run the code below withxmax=1.1
versusxmax=1.0
, the axvspan is plotted wrong in latex. Inspection of the pgf file for the two versions ofxmax
indicates that a\pgfpathlineto
command is missing in thexmax=1.1
version. I've traced it to_print_pgf_path()
in the backend and the linefor points, code in path.iter_segments(transform, clip=clip):
which is asking for clipped points.
Python Code
import matplotlib.pyplot as pltfig = plt.figure()ax = fig.add_subplot(111)ax.plot([0,1],[0,1],'-k')ax.set_xlim(0,1)ax.axvspan(xmin=0.5, xmax=1.1)fig.savefig('test.pgf')
Latex code
\documentclass {article}\usepackage{pgf}\begin{document} \begin{figure} \centering \input{test.pgf} \end{figure}\end{document
Here is a pic of the result after compiled with latex (pdflatex or xelatex)
However, saving to .pdf produces the right result