import matplotlib.pyplot as plt
import numpy as np
 
from Orange.data import Table
from orangecontrib.spectroscopy.data import getx
 
spectra = in_data.X
energy = getx(in_data) #This is specfic to getting data from Orange data files


fig, ax = plt.subplots()
#fig, (ax, ax2,ax3) = plt.subplots(1,3)     

ax.plot(energy, spectra[0], 'indigo', linewidth=1.0, label='collagen') #add label='label text' if you want to add a legend
 
#ax2.plot(energy, spectra[1], 'darkblue', linewidth=1.0, label='glycogen') #add label='label text' if you want to add a legend 
 
#ax3.plot(energy, spectra[2], 'blue', linewidth=1.0, label='lipids') #add label='label text' if you want to add a legend 
 
#add title
title = ax.set_title('Plot: Three Spectra, three plots',fontsize='10', loc='left') #  location = centre, left, right (default is centre)
 
 
#add axis labels for left plot
ax.set_xlabel('Wavenumber / cm$^{-1}$', fontsize='12')
ax.set_ylabel('Absorbance', fontsize='12')

 
#set axis limits -->can  use to reverse axis for IR spectra
ax.set(xlim=(1850, 850)) #this is the wavenumber region you want to show
ax.set(ylim=(0,1.1)) #this is the absorbance range


#annotate 
ax.annotate('key peak', xy=(1600,0.8), xytext=(1400,0.7), arrowprops=dict(facecolor='black', width=0.4, headwidth=6, shrink=0.05),)

 
#ax.legend() #if you added label text you need this to make a legend

plt.show()