Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
CLIMATE-949 - Enlarge font size on Taylor diagrams
Browse files Browse the repository at this point in the history
- plotter.draw_taylor_diagram has a new parameter, legend_size, to control the font size of the legend
  • Loading branch information
huikyole committed May 15, 2018
1 parent 5d9dfcf commit 5d980b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ocw/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _fig_size(gridshape, aspect=None):

def draw_taylor_diagram(results, names, refname, fname, fmt='png',
gridshape=(1, 1), ptitle='', subtitles=None,
pos='upper right', frameon=True, radmax=1.5):
pos='upper right', frameon=True, radmax=1.5, legend_size=13):
''' Draw a Taylor diagram.
:param results: An Nx2 array containing normalized standard deviations,
Expand Down Expand Up @@ -209,6 +209,9 @@ def draw_taylor_diagram(results, names, refname, fname, fmt='png',
:param radmax: (Optional) float to adjust the extent of the axes in terms of
standard deviation.
:type radmax: :class:`float`
:param legend_size: (Optional) float to control the font size of the legend
:type legend_size: :class:`float`
'''
# Handle the single plot case.
if results.ndim == 2:
Expand Down Expand Up @@ -239,7 +242,7 @@ def draw_taylor_diagram(results, names, refname, fname, fmt='png',
# Add legend
legend = fig.legend(dia.samplePoints,
[p.get_label() for p in dia.samplePoints],
handlelength=0., prop={'size': 10}, numpoints=1,
handlelength=0., prop={'size': legend_size}, numpoints=1,
loc=pos)
legend.draw_frame(frameon)
plt.subplots_adjust(wspace=0)
Expand Down

0 comments on commit 5d980b4

Please sign in to comment.