Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make evenly spaced ticks when threshold_values are not evenly spaced in CSI plots #302

Merged
merged 10 commits into from
Nov 21, 2024
2 changes: 1 addition & 1 deletion docs/appendix/yaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ for csi plot, list of model names (only) user choose to set as labels.

**score_name:** csi plot only. list of scores user can choose to plot. examples are "Critical Success Index' 'False Alarm Rate' 'Hit Rate'.

**threshold_tick_style:** csi plot only. (optional) control for spacing of threshold (x-axis) ticks. example: use ``unique`` when a unique xtick for each threshold value is desired. Any other selection (default = None) will choose xticks that are equally spaced between min(threshold_list):max(threshold_list).
**threshold_tick_style:** csi plot only. (optional) control for spacing of threshold (x-axis) ticks. example: use ``nonlinear`` when nonlinear xticks are desired. Any other selection (default = None) will choose xticks that are equally spaced between min(threshold_list):max(threshold_list).
zmoon marked this conversation as resolved.
Show resolved Hide resolved

**data:** This a list of model / observation pairs to be plotted where the
observation label is first and the model label is second
Expand Down
4 changes: 2 additions & 2 deletions melodies_monet/plots/surfplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ def Plot_CSI(score_name_input,threshold_list_input, comb_bx_input,plot_dict,fig_

#Make Plot
for i in range(len(CSI_output)):
if threshold_tick_style == 'unique':
if threshold_tick_style == 'nonlinear':
plt.plot(range(len(threshold_list)),CSI_output[i],'-*',label=model_name_list[i])
else:
plt.plot(threshold_list,CSI_output[i],'-*',label=model_name_list[i])
Expand All @@ -1578,7 +1578,7 @@ def Plot_CSI(score_name_input,threshold_list_input, comb_bx_input,plot_dict,fig_
plt.grid()

#add '>' to xticks
if threshold_tick_style == 'unique':
if threshold_tick_style == 'nonlinear':
threshold_string_array = [str(x) for x in threshold_list]
labels = ['>'+item for item in threshold_string_array]
ax.set_xticks(range(len(threshold_list)),labels=labels)
Expand Down
Loading