You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by go...@apache.org on 2018/05/16 19:02:52 UTC

climate git commit: CLIMATE-949 - Enlarge font size on Taylor diagrams

Repository: climate
Updated Branches:
  refs/heads/master 5d9dfcfb7 -> 5d980b4df


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


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/5d980b4d
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/5d980b4d
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/5d980b4d

Branch: refs/heads/master
Commit: 5d980b4dfddd04380da324ab7f32ebf9b873cecb
Parents: 5d9dfcf
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Tue May 15 13:50:39 2018 -0700
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Tue May 15 13:50:39 2018 -0700

----------------------------------------------------------------------
 ocw/plotter.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/5d980b4d/ocw/plotter.py
----------------------------------------------------------------------
diff --git a/ocw/plotter.py b/ocw/plotter.py
index be606f8..3de540b 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)