Skip to content
Snippets Groups Projects
Commit 2a86494b authored by Diego Gomes's avatar Diego Gomes
Browse files

Replace analysistool.py

parent 9ce7e003
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ class AnalysisTool:
self.data[cropsite_name] = cropsite_object.data
def boxplot(self, croptype):
def boxplot(self, croptype, save=False):
"""Plot relative deltas of different cropsites for a give croptype"""
colors = ['#134e6f', '#ffa822', '#ff6150', '#1ac0c6']
......@@ -55,7 +55,7 @@ class AnalysisTool:
if month in data.values:
months.append(month)
plt.figure(figsize=(10,10))
plt.figure(figsize=(10,20))
axs = sns.boxplot(x='Month', y='Delta', hue='Cropsite', palette=colors, data=data, order=months)
axs.set_title(croptype)
axs.set_ylabel('Relative Difference in Latent Heat Flux [%]')
......@@ -65,10 +65,13 @@ class AnalysisTool:
pass
axs.axhline(0, color='black', linestyle='-')
if save != False:
plt.savefig(save)
plt.show()
def scatterplot(self, croptype, cropsite='all', combine=True):
def scatterplot(self, croptype, cropsite='all', combine=True, save=False):
"""Plot latent heat values: MODIS vs FLUXNET"""
colors = ['#134e6f', '#ffa822', '#ff6150', '#1ac0c6']
......@@ -125,5 +128,8 @@ class AnalysisTool:
axs.set_ylabel('FLUXNET Latent Heat Flux [W m-2]')
plt.legend()
if save != False:
plt.savefig(save)
plt.show()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment