Astro Data Lab Home
Astro Data Lab User Forum
Toggle navigation
Username
Password
Remember
Login
Register
|
I forgot my password
Forum home
All Activity
Questions
Unanswered
Tags
Categories
Users
Ask a Question
latex formatting of matplotlib labels seems to be broken?
0
votes
1,493
views
I am running a notebook that worked last time I logged into DataLab, but now am getting the following error when trying to plot using matplotlib.pyplot:
"RuntimeError: Failed to process string with tex because dvipng could not be found"
Any idea what has recently changed that would have made matplotlib unable to locate latex/dvipng?
matplotlib
latex
dvipng
asked
Sep 7, 2020
by
jcarlin
(
160
points)
|
1,493
views
answer
comment
flag
Here are the contents of the cell I am trying to execute:
params = {
'axes.labelsize': 20,
'font.size': 20,
'legend.fontsize': 14,
# 'xtick.labelsize': 16,
'xtick.major.width': 3,
'xtick.minor.width': 2,
'xtick.major.size': 8,
'xtick.minor.size': 5,
'xtick.direction': 'in',
'xtick.top': True,
'lines.linewidth':3,
'axes.linewidth':3,
'axes.labelweight':3,
'axes.titleweight':3,
'ytick.major.width':3,
'ytick.minor.width':2,
'ytick.major.size': 8,
'ytick.minor.size': 5,
'ytick.direction': 'in',
'ytick.right': True,
# 'ytick.labelsize': 20,
'text.usetex': True,
'text.latex.preamble': r'\boldmath',
'figure.figsize': [7,9]
}
plt.rcParams.update(params)
#plt.plot(g0-i0,i0,'k.',alpha=0.01)
plt.plot(g0[star & cen]-i0[star & cen],i0[star & cen],'c.',alpha=0.2)
plt.ylim(25.8,16.8)
plt.xlim(-1,4)
plt.xlabel(r'$(g-i)_0$')
plt.ylabel(r'$i_0$')
plt.minorticks_on()
Please
log in
or
register
to add a comment.
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Add answer
Cancel
1 Answer
0
votes
Actually, I logged out of DataLab and logged back in, and this problem went away. I'm guessing that my login was "stale," and my path wasn't set up correctly...
answered
Sep 7, 2020
by
jcarlin
(
160
points)
comment
flag
ask related question
I can't explain why it previously might have worked, however 'dvipng' was not installed on the machine. It was installed but I became distracted before replying so it's possible that you picked up the new binary afterwards.
Please
log in
or
register
to add a comment.
359
questions
372
answers
385
comments
2,451
users
Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.