Skip to content

Commit

Permalink
[USGS-R#184] improvements to barplots
Browse files Browse the repository at this point in the history
reorder models, mark val sites
  • Loading branch information
jsadler2 committed Jul 31, 2023
1 parent bbf0c28 commit a14273a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions 3_visualize/src/python_scripts/plot_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import matplotlib.pyplot as plt
validation_sites = ["01472104", "01473500", "01481500"]
test_sites = ["01475530", "01475548"]

model_order = ["0_baseline_LSTM", "1a_multitask_do_gpp_er",
"1_metab_multitask", "2_multitask_dense"]

def mark_val_sites(ax):
labels = [item.get_text() for item in ax.get_xticklabels()]
new_labels = []
for l in labels:
if l in validation_sites:
new_labels.append("*" + l)
else:
new_labels.append(l)

ax.set_xticklabels(new_labels)

fig = plt.gcf()
fig.text(0.5, 0, "* validation site")

return ax

0 comments on commit a14273a

Please sign in to comment.