Commit d6287e58 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[PAPER 1] add legend for markers

parent e96fff75
No related merge requests found
Showing with 19 additions and 3 deletions
+19 -3
import datetime import datetime
from matplotlib.patches import Polygon
from matplotlib.lines import Line2D
from matplotlib.markers import MarkerStyle
from matplotlib.patches import Polygon, Patch
import io import io
import os import os
import os.path as op import os.path as op
...@@ -396,6 +399,19 @@ class AbstractStudy(object): ...@@ -396,6 +399,19 @@ class AbstractStudy(object):
if axis_off: if axis_off:
plt.axis('off') plt.axis('off')
# Add legend for the marker
if massif_name_to_marker_style is not None:
labels = ['\mathcal{M}_{\mu_1}', '\mathcal{M}_{\sigma_1}', '\mathcal{M}_{\mu_1, \sigma_1}']
markers = ["s", "^", "D"]
legend_elements = [
Line2D([0], [0], marker=marker, color='w', label='${}$'.format(label),
markerfacecolor='w', markeredgecolor='k', markersize=8)
for label, marker in zip(labels, markers)
]
ax.legend(handles=legend_elements, bbox_to_anchor=(0.01, 0.03), loc='lower left')
ax.annotate("Filled symbol = significant trend ", xy=(0.05, 0.015), xycoords='axes fraction',
fontsize=7)
if show: if show:
plt.show() plt.show()
......
...@@ -58,9 +58,9 @@ def major_result(): ...@@ -58,9 +58,9 @@ def major_result():
if __name__ == '__main__': if __name__ == '__main__':
major_result() # major_result()
# intermediate_result(paper_altitudes) # intermediate_result(paper_altitudes)
# minor_result(altitude=600) minor_result(altitude=600)
# intermediate_result(altitudes=[1500, 1800], massif_names=['Chartreuse'], # intermediate_result(altitudes=[1500, 1800], massif_names=['Chartreuse'],
# uncertainty_methods=[ConfidenceIntervalMethodFromExtremes.ci_mle, # uncertainty_methods=[ConfidenceIntervalMethodFromExtremes.ci_mle,
# ConfidenceIntervalMethodFromExtremes.ci_bayes], # ConfidenceIntervalMethodFromExtremes.ci_bayes],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment