From 9cff5a77afe848d265f1bc658170460a07e93c4f Mon Sep 17 00:00:00 2001 From: Fabian Rost Date: Thu, 28 Mar 2019 13:39:55 +0100 Subject: [PATCH] DOC: remove ncols, wspace, hspace from pl.scatter doc (#557) fixes #458 --- scanpy/plotting/_anndata.py | 6 +++--- scanpy/plotting/_docs.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/scanpy/plotting/_anndata.py b/scanpy/plotting/_anndata.py index 12959b6b46..ef95e1801c 100755 --- a/scanpy/plotting/_anndata.py +++ b/scanpy/plotting/_anndata.py @@ -17,7 +17,7 @@ from . import _utils as utils from ._utils import scatter_base, scatter_group, setup_axes from ..utils import sanitize_anndata, doc_params -from ._docs import doc_scatter_bulk, doc_show_save_ax, doc_common_plot_args +from ._docs import doc_scatter_temp, doc_show_save_ax, doc_common_plot_args VALID_LEGENDLOCS = { 'none', 'right margin', 'on data', 'on data export', 'best', 'upper right', 'upper left', @@ -26,7 +26,7 @@ } -@doc_params(scatter_bulk=doc_scatter_bulk, show_save_ax=doc_show_save_ax) +@doc_params(scatter_temp=doc_scatter_temp, show_save_ax=doc_show_save_ax) def scatter( adata, x=None, @@ -78,7 +78,7 @@ def scatter( `(layers, layers, layers)`. basis : {{'pca', 'tsne', 'umap', 'diffmap', 'draw_graph_fr', etc.}} String that denotes a plotting tool that computed coordinates. - {scatter_bulk} + {scatter_temp} {show_save_ax} Returns diff --git a/scanpy/plotting/_docs.py b/scanpy/plotting/_docs.py index 5f83999208..b4119d7b73 100644 --- a/scanpy/plotting/_docs.py +++ b/scanpy/plotting/_docs.py @@ -32,7 +32,7 @@ """ -doc_scatter_bulk = """\ +_doc_scatter_common = """\ sort_order For continuous annotations used as color parameter, plot data points with higher values on top of others. @@ -69,12 +69,16 @@ frameon Draw a frame around the scatter plot. Defaults to value set in :func:`~scanpy.api.tl.set_figure_params`, defaults to `True`. +""" +_doc_scatter_panels = """\ ncols Number of panels per row. wspace Adjust the width of the space between multiple panels. hspace Adjust the height of the space between multiple panels. +""" +_doc_scatter_meta = """\ title Provide title for panels either as string or list of strings, e.g. `['title1', 'title2', ...]`. @@ -85,6 +89,11 @@ Return the matplotlib figure.\ """ +# temporarily add a special variable doc_scatter_temp for pl.scatter +# because currently pl.scatter does not accept ncols, wspace, and hspace +doc_scatter_temp = _doc_scatter_common + _doc_scatter_meta +doc_scatter_bulk = _doc_scatter_common + _doc_scatter_panels + _doc_scatter_meta + doc_show_save_ax = """\ show