Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text color not respected in output from pgf backend #3779

Closed
mrclary opened this issue Nov 10, 2014 · 2 comments
Closed

Text color not respected in output from pgf backend #3779

mrclary opened this issue Nov 10, 2014 · 2 comments

Comments

@mrclary
Copy link

mrclary commented Nov 10, 2014

It appears that for the TeXLive 2014 distribution, the text color is not respected in output from the pgf backend and is only rendered in black. TeXLive 2013 does not exhibit this behavior for any versions of Matplotlib (1.3.1 through 1.4.2). The question is whether this is a bug in the PGF code in the TexLive distribution, or whether there was a legitimate change that requires an update to the pgf backend.

Following is a MWE that exhibits the behavior. All that is required is to switch your TeXLive distribution.

import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pgf import FigureCanvasPgf
mpl.backend_bases.register_backend('pdf', FigureCanvasPgf)

plt.rcParams['font.family'] = 'Arial'
plt.rcParams['font.size'] = 18
plt.rcParams['pgf.rcfonts'] = False

plt.plot(range(10))
plt.text(3, 6, 'Text', color='red')
plt.xlabel('x axis label', color='blue')
plt.ylabel('y axis label', color='green')

plt.savefig('untitled.pdf')
@tacaswell
Copy link
Member

attn @pwuertz

@tacaswell tacaswell added this to the unassigned milestone Nov 10, 2014
@pwuertz
Copy link
Contributor

pwuertz commented Nov 11, 2014

Indeed, I see the same issue on my system. \pgftext apparently changed its behaviour in TexLive2014. This PR should fix it.

tacaswell added a commit that referenced this issue Nov 11, 2014
BUG : backend_pgf: \pgftext now requires \color inside argument (fix #3779) [backport to 1.4.x]
tacaswell added a commit that referenced this issue Nov 11, 2014
BUG : backend_pgf: \pgftext now requires \color inside argument (fix #3779) [backport to 1.4.x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants