0 votes
41 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?
asked Sep 7 by jcarlin (160 points) | 41 views
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()

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 by jcarlin (160 points)
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.

198 questions

195 answers

183 comments

1,364 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.