From 5d980b4dfddd04380da324ab7f32ebf9b873cecb Mon Sep 17 00:00:00 2001 From: huikyole Date: Tue, 15 May 2018 13:50:39 -0700 Subject: [PATCH] CLIMATE-949 - Enlarge font size on Taylor diagrams - plotter.draw_taylor_diagram has a new parameter, legend_size, to control the font size of the legend --- ocw/plotter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ocw/plotter.py b/ocw/plotter.py index be606f83..3de540b7 100755 --- a/ocw/plotter.py +++ b/ocw/plotter.py @@ -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, @@ -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: @@ -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)