Skip to content

Commit

Permalink
fix pep8 and typo
Browse files Browse the repository at this point in the history
  • Loading branch information
webersa committed Feb 5, 2019
1 parent dddfc63 commit 48319ff
Showing 1 changed file with 37 additions and 34 deletions.
71 changes: 37 additions & 34 deletions adjustText/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,34 +365,37 @@ def adjust_text(texts, x=None, y=None, add_objects=None, ax=None,
Other Parameters
----------------
x : array_like
x-coordinates of points to repel from; if not provided only uses text coordinates.
x-coordinates of points to repel from; if not provided only uses text
coordinates.
y : array_like
y-coordinates of points to repel from; if not provided only uses text coordinates
y-coordinates of points to repel from; if not provided only uses text
coordinates
add_objects : list
a list of additional matplotlib objects to avoid; they must have a
.get_window_extent() method.
`.get_window_extent()` method.
ax : matplotlib axe, default is current axe (plt.gca())
axe object with the plot
expand_text : array_like, default (1.05, 1.2)
a tuple/list/... with 2 multipliers (x, y) by which to expand the bounding box of
texts when repelling them from each other.
a tuple/list/... with 2 multipliers (x, y) by which to expand the
bounding box of texts when repelling them from each other.
expand_points : array_like, default (1.05, 1.2)
a tuple/list/... with 2 multipliers (x, y) by which to expand the bounding box of
texts when repelling them from points.
a tuple/list/... with 2 multipliers (x, y) by which to expand the
bounding box of texts when repelling them from points.
expand_objects : array_like, default (1.05, 1.2)
a tuple/list/... with 2 multipliers (x, y) by which to expand the bounding box of
texts when repelling them from other objects.
a tuple/list/... with 2 multipliers (x, y) by which to expand the
bounding box of texts when repelling them from other objects.
expand_align : array_like, default (1.05, 1.2)
a tuple/list/... with 2 multipliers (x, y) by which to expand the bounding box of
texts when autoaligning texts.
a tuple/list/... with 2 multipliers (x, y) by which to expand the
bounding box of texts when autoaligning texts.
autoalign: str or boolean {'xy', 'x', 'y', True, False}, default 'xy'
Direction alongwith the best alignement will be determined
* 'xy' or True, best alignment of all texts determined in all directions
automatically before running the iterative adjustment (overriding va and ha),
* 'x', will only align horizontally,
* 'y', will only align vertically,
* False, do nothing (i.e. preserve va and ha)
Direction in wich the best alignement will be determined
- 'xy' or True, best alignment of all texts determined in all
directions automatically before running the iterative adjustment
(overriding va and ha),
- 'x', will only align horizontally,
- 'y', will only align vertically,
- False, do nothing (i.e. preserve va and ha)
va : str, default 'center'
vertical alignment of texts
ha : str
Expand All @@ -406,37 +409,37 @@ def adjust_text(texts, x=None, y=None, add_objects=None, ax=None,
lim : int, default 500
limit of number of iterations
precision : float, default 0.01
iterate until the sum of all overlaps along both x and y are less than this
amount, as a fraction of the total widths and heights, respectively. May need to
increase for complicated situations.
iterate until the sum of all overlaps along both x and y are less than
this amount, as a fraction of the total widths and heights,
respectively. May need to increase for complicated situations.
only_move : dict, default {'points':'xy', 'text':'xy', 'objects':'xy'}
a dict to restrict movement of texts to only certain axes for certain types of
overlaps.
Valid keys are 'points', 'text', and 'objects'.
a dict to restrict movement of texts to only certain axes for certain
types of overlaps.
Valid keys are 'points', 'text', and 'objects'.
Valid values are '', 'x', 'y', and 'xy'.
For example, only_move={'points':'y', 'text':'xy', 'objects':'xy'}
forbids moving texts along the x axis due to overlaps with points.
Default: everything is allowed.
text_from_text : bool, default True
whether to repel texts from each other.
text_from_points : bool, default True
whether to repel texts from points. Can be helpful to switch off in extremely
crowded plots.
whether to repel texts from points. Can be helpful to switch off in
extremely crowded plots.
save_steps : bool, default False
whether to save intermediate steps as images.
save_prefix : str, default ''
if `save_steps` is True, a path and/or prefix to the saved steps.
save_format : str, default 'png'
if `save_steps` is True, a format to save the steps into.
add_step_numbers : bool
if `save_steps` is True, whether to add step numbers as titles to the images of
saving steps.
if `save_steps` is True, whether to add step numbers as titles to the
images of saving steps.
on_basemap : bool, default False
whether your plot uses the basemap library, stops labels going over the edge of
the map.
args and kwargs:
any arguments will be fed into obj:`ax.annotate` after all the optimization is
done just for plotting the connecting arrows if required
whether your plot uses the basemap library, stops labels going over the
edge of the map.
args and kwargs :
any arguments will be fed into obj:`ax.annotate` after all the
optimization is done just for plotting the connecting arrows if
required.
Return
------
Expand Down

0 comments on commit 48319ff

Please sign in to comment.