So, here are some fragments of my code that are pertinent to the problem. When I go to run this function, I get an error message that ends with RuntimeError: Failed to process string with tex because latex could not be found. I have absolutely no idea what could be causing this.
from glob import glob
import numpy as np
import scipy
import scipy.special
from scipy.special import logsumexp
from scipy.signal import savgol_filter
import numba as nb
import math
import matplotlib.cm as cm
import time as t
import os
plt.rcParams['text.usetex'] = True
def PlotPhaseEnergies():
percentCut = 0.45
plt.xlim(-35,25)
phaseColors = ['red','orange','yellow','green']
for bend in temps['BendingStrength'].unique():
bendnum = float(bend)
E,glog = histReweight(folder,bend)
Estep=E[1]-E[0]
S=glog[np.isfinite(glog)]
Elim = E[np.isfinite(glog)]
E_0 = []
for entry in Elim:
E_0.append(entry)
E_0 = np.array(E_0)
prevE_Phase = []
for j in range(3):
w = findWindowLength(S,j+3,Estep,0.8)
Derivative = savgol_filter(S, window_length = w, polyorder=(j+3), deriv=(j+3), delta=Estep)
Derivative = Derivative[:int(len(Derivative)*percentCut)]
CheckList = np.multiply(Derivative[1:].copy(),Derivative[:-1].copy())
ZeroCrossings = [num for num in CheckList if num < 0]
ZeroCrossings = [v for i, v in enumerate(ZeroCrossings) if i % 2 == 0]
indices = []
for k in range(len(ZeroCrossings)):
index = np.where(CheckList == ZeroCrossings[k])
indices.append(int(index[0]))
E_phase = E_0[indices]
rawE_phase = E_phase
E_phase = E_phase[len(prevE_Phase):]
if len(E_phase) > 0:
for energy in E_phase:
plt.plot(energy, bendnum,marker = "o",markersize=10,markeredgecolor = phaseColors[j],markerfacecolor = phaseColors[j])
prevE_Phase = rawE_phase
plt.savefig("PhaseDiagram.png")
I have tried resetting the rcParams for plt, but that seems to have done nothing.
New contributor
The Robotics Guy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.