Return-Path: X-Original-To: apmail-climate-commits-archive@minotaur.apache.org Delivered-To: apmail-climate-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CB54D11ECF for ; Wed, 2 Jul 2014 13:33:08 +0000 (UTC) Received: (qmail 95430 invoked by uid 500); 2 Jul 2014 13:33:08 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 95354 invoked by uid 500); 2 Jul 2014 13:33:08 -0000 Mailing-List: contact commits-help@climate.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.apache.org Delivered-To: mailing list commits@climate.apache.org Received: (qmail 95291 invoked by uid 99); 2 Jul 2014 13:33:08 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2014 13:33:08 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 199B59934A4; Wed, 2 Jul 2014 13:33:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: joyce@apache.org To: commits@climate.apache.org Date: Wed, 02 Jul 2014 13:33:11 -0000 Message-Id: In-Reply-To: <6b476f47a12744deb295afd65832e190@git.apache.org> References: <6b476f47a12744deb295afd65832e190@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [5/6] git commit: CLIMATE-241 - Update draw_portrait_diagram docstring format CLIMATE-241 - Update draw_portrait_diagram docstring format Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/e5ca8698 Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/e5ca8698 Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/e5ca8698 Branch: refs/heads/master Commit: e5ca8698839f399d376d62038554649bd3be7329 Parents: 007bc9a Author: Michael Joyce Authored: Tue Jul 1 09:35:44 2014 -0700 Committer: Michael Joyce Committed: Tue Jul 1 09:35:44 2014 -0700 ---------------------------------------------------------------------- ocw/plotter.py | 69 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/e5ca8698/ocw/plotter.py ---------------------------------------------------------------------- diff --git a/ocw/plotter.py b/ocw/plotter.py index fc3996a..f1370d1 100644 --- a/ocw/plotter.py +++ b/ocw/plotter.py @@ -622,35 +622,48 @@ def draw_portrait_diagram(results, rowlabels, collabels, fname, fmt='png', gridshape=(1, 1), xlabel='', ylabel='', clabel='', ptitle='', subtitles=None, cmap=None, clevs=None, nlevs=10, extend='neither', aspect=None): - ''' - Purpose:: - Makes a portrait diagram plot. + ''' Draw a portrait diagram plot. - Input:: - results - 3d array of the field to be plotted. The second dimension - should correspond to the number of rows in the diagram and the - third should correspond to the number of columns. - rowlabels - a list of strings denoting labels for each row - collabels - a list of strings denoting labels for each column - fname - a string specifying the filename of the plot - fmt - an optional string specifying the output filetype - gridshape - optional tuple denoting the desired grid shape (nrows, ncols) for arranging - the subplots. - xlabel - an optional string specifying the x-axis title - ylabel - an optional string specifying the y-axis title - clabel - an optional string specifying the colorbar title - ptitle - a string specifying the plot title - subtitles - an optional list of strings specifying the title for each subplot - cmap - an optional string or matplotlib.colors.LinearSegmentedColormap instance - denoting the colormap - clevs - an optional list of ints or floats specifying colorbar levels - nlevs - an optional integer specifying the target number of contour levels if - clevs is None - extend - an optional string to toggle whether to place arrows at the colorbar - boundaries. Default is 'neither', but can also be 'min', 'max', or - 'both'. Will be automatically set to 'both' if clevs is None. - aspect - Float denoting approximate aspect ratio of each subplot - (width / height). Default is 8.5 / 5.5 + :param results: 3D array of the fields to be plotted. The second dimension + should correspond to the number of rows in the diagram and the + third should correspond to the number of columns. + :type results: Numpy Array + :param rowlabels: Labels for each row. + :type rowlabels: List of strings + :param collabels: Labels for each row. + :type collabels: List of strings + :param fname: Filename of the plot. + :type fname: string + :param fmt: Optional filetype for the output. + :type fmt: string + :param gridshape: Optional tuple denoting the desired grid shape + (num_rows, num_cols) for arranging the subplots. + :type gridshape: Tuple (num_rows, num_cols) + :param xlabel: Optional x-axis title. + :type xlabel: string + :param ylabel: Optional y-ayis title. + :type ylabel: string + :param clabel: Optional colorbar title. + :type clabel: string + :param ptitle: Optional plot title. + :type ptitle: string + :param subtitles: Optional list of titles for each subplot. + :type subtitles: List of strings + :param cmap: Optional string or matplotlib.colors.LinearSegmentedColormap + instance denoting the colormap. This must be able to be recognized by + `Matplotlib's get_cmap function `_. + :type cmap: string or LinearSegmentedColormap object + :param clevs: Optional contour levels values. + :type clevs: List of ints or floats + :param nlevs: Optional target number of contour levels if clevs is None. + :type nlevs: int + :param extend: Optional flag to toggle whether to place arrows at the colorbar + boundaries. Default is 'neither', but can also be 'min', 'max', or + 'both'. Will be automatically set to 'both' if clevs is None. + :type extend: string + :param aspect: Optional approximate aspect ratio of each subplot + (width / height). Default is 8.5 / 5.5 + :type aspect: float ''' # Handle the single plot case. if results.ndim == 2: