I keep getting error:
/opt/anaconda3/lib/python3.8/site-packages/IPython/core/pylabtools.py:151: UserWarning: Glyph 26 () missing from current font.
fig.canvas.print_figure(bytes_io, **kw)
With the following code:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
class Raman:
def __init__(self):
'''Initialise the class instance'''
def readcsv(self,filename,skipheader=2):
'''
Returns the xth column from an input csv file
filename : Input csv filename
'''
data = pd.read_csv(filename, encoding= 'unicode_escape')
data2 = data.to_numpy()
x = data2[:,0]
y1 = data2[:,1]
y2 = data2[:,2]
y3 = data2[:,3]
av = data2[:,4]
return (x,y1,y2,y3,av)
def plotRaman(self, x, y, maxh=300,title='Raman'):
'''
Plot Raman spectrum
'''
plt.plot(x, y,lw=0.8)
plt.xlabel("Raman shift")
plt.ylabel("Intensity")
plt.title(title)
plt.show()
# Introduce class
s = Raman()
#Import csv files
x_0201, y1_0201, y2_0201, y3_0201, y_0201 = s.readcsv("02_01.csv")
#Plot graph
s.plotRaman(x_0201,y_0201,900,'0201')
My plot output looks like this:
Everything else runs fine other than the plot output.
I've tried resetting Anaconda/ Spyder which I am using and it doesn't work.
