Skip to content

Commit

Permalink
Minor docs tweaks, remove print statement
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Jan 15, 2022
1 parent e609f01 commit 4eb15f7
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/1dplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@
# positions are adjusted according to the number of bars in the group.
#
# The `~proplot.axes.PlotAxes.fill_between` and `~proplot.axes.PlotAxes.fill_betweenx`
# have the new shorthands `~proplot.axes.PlotAxes.area`
# commands have the new shorthands `~proplot.axes.PlotAxes.area`
# and `~proplot.axes.PlotAxes.areax`. Similar to `~proplot.axes.PlotAxes.bar` and
# `~proplot.axes.PlotAxes.barh`, they apply default *x* coordinates if you failed
# to provide them explicitly, and can *overlay* or *stack* successive columns of
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ h6{
body.scroll-up,
body.scroll-down,
.wy-nav-content {
max-width: 60em;
max-width: 58em;
background: var(--main-bg-color);
}

Expand Down
30 changes: 14 additions & 16 deletions docs/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,16 @@
# a "python-style" object-oriented interface with axes-level commands
# like `matplotlib.axes.Axes.plot`, and a "MATLAB-style" interface
# with global commands like `matplotlib.pyplot.plot` that tracks "current" axes.
# Rather than adding to the `~matplotlib.pyplot` namespace,
# proplot uses the intermediate subclass `proplot.axes.PlotAxes`
# to modify existing axes-level commands and add a few new ones.
# While certain `~proplot.axes.PlotAxes` features may be accessible via
# the relevant `~matplotlib.pyplot` commands, proplot only officially supports
# the "python-style" axes-level commands.

# `~proplot.axes.PlotAxes` does not change the usage or syntax of existing commands,
# which means a shallow learning curve for the average matplotlib user. It also tries
# to :ref:`standardize the positional arguments <ug_1dstd>` and optional keyword
# arguments accepted by similar or analogous commands, providing an arguably more
# intuitive interface. In the below example, we create a 4-panel figure with the
# Proplot takes advantage of the "python-style" interface by adding and modifying
# axes-level commands using the intermediate class `proplot.axes.PlotAxes`. While
# certain `~proplot.axes.PlotAxes` features may be accessible via `~matplotlib.pylot`
# commands, proplot only officially supports the "python-style" interface.

# `~proplot.axes.PlotAxes` does not change the usage of existing commands,
# which means a shallow learning curve for the average matplotlib user. It also
# :ref:`expands the positional arguments <ug_1dstd>` and optional keyword
# arguments accepted by commands to provide an arguably more intuitive
# interface. In the below example, we create a 4-panel figure with the
# familiar "1D" plotting commands `~proplot.axes.PlotAxes.plot` and
# `~proplot.axes.PlotAxes.scatter`, along with the "2D" plotting commands
# `~proplot.axes.PlotAxes.pcolormesh` and `~proplot.axes.PlotAxes.contourf`.
Expand Down Expand Up @@ -279,9 +277,9 @@
# a "python-style" object-oriented interface with instance-level commands
# like `matplotlib.axes.Axes.set_title`, and a "MATLAB-style" interface
# that tracks current axes and provides global commands like
# `matplotlib.pyplot.title`. Proplot provides the ``format`` command as a
# succinct and powerful alternative for formatting a variety of plot elements. While
# matplotlib's one-liner commands still work, ``format`` only needs to be
# `matplotlib.pyplot.title`. Proplot provides the ``format`` command as an
# alternative "python-style" command for formatting a variety of plot elements.
# While matplotlib's one-liner commands still work, ``format`` only needs to be
# called once and tends to cut down on boilerplate code. You can call
# ``format`` manually or pass ``format`` parameters to axes-creation commands
# like `~proplot.figure.Figure.subplots`, `~proplot.figure.Figure.add_subplot`,
Expand Down Expand Up @@ -318,7 +316,7 @@
# * `~proplot.config.rc` settings. Any keyword matching the name
# of an rc setting is locally applied to the figure and axes.
# If the name has "dots", you can pass it as a keyword argument with
# the "dots" omitted or pass it to `rc_kw` in a dictionary. For example, the
# the "dots" omitted, or pass it to `rc_kw` in a dictionary. For example, the
# default a-b-c label location is controlled by :rcraw:`abc.loc`. To change
# this for an entire figure, you can use ``fig.format(abcloc='right')``
# or ``fig.format(rc_kw={'abc.loc': 'right'})``.
Expand Down
4 changes: 2 additions & 2 deletions docs/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@
#
# .. note::
#
# Unlike matplotlib, proplot adds alternate axes as :ref:`children
# Unlike matplotlib, proplot adds alternate axes as `children
# <https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.add_child_axes.html>`__
# of the original axes. This considerably simplifies the :ref:`tight layout algorithm
# of the original axes. This helps simplify the :ref:`tight layout algorithm
# <ug_tight>` but means that the drawing order is controlled by the difference
# between the zorders of the alternate axes and the content *inside* the original
# axes rather than the zorder of the original axes itself (see `this issue page
Expand Down
1 change: 1 addition & 0 deletions docs/insets_panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
state = np.random.RandomState(51423)
x, y = np.arange(10), np.arange(10)
data = state.rand(10, 10).cumsum(axis=0)
data = np.flip(data, (0, 1))

# Plot data in the main axes
fig, ax = pplt.subplots(refwidth=3)
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinxext/custom_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _node_list(rawtext, text, inliner):
else:
path = '../' * relsource[1].count('/') + 'en/stable'
refuri = f'{path}/configuration.html?highlight={text}#table-of-settings'
node = nodes.Text(f"rc[\\'{text}\\']" if '.' in text else f'rc.{text}')
node = nodes.Text(f'rc[{text!r}]' if '.' in text else f'rc.{text}')
ref = nodes.reference(rawtext, node, refuri=refuri)
return [nodes.literal('', '', ref)]

Expand Down
2 changes: 1 addition & 1 deletion docs/why.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ subplot in the figure. This is partly because you must specify the physical
dimensions of the figure, despite the fact that...

#. The subplot aspect ratio is generally more relevant than the figure
aspect ratio. An aspect ratio of ``1`` is desirable for most plots, and
aspect ratio. A default aspect ratio of ``1`` is desirable for most plots, and
the aspect ratio must be held fixed for :ref:`geographic and polar <ug_proj>`
projections and most `~matplotlib.axes.Axes.imshow` plots.
#. The subplot width and height control the "apparent" size of lines, markers,
Expand Down
1 change: 0 additions & 1 deletion proplot/axes/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,6 @@ def _sanitize_levels(key, array, minsize):
else:
# Generate levels so that ticks will be centered between edges
# Solve: (x1 + x2) / 2 = y --> x2 = 2 * y - x1 with arbitrary starting x1.
print('hi!!!', values)
descending = values[1] < values[0]
if descending: # e.g. [100, 50, 20, 10, 5, 2, 1] successful if reversed
values = values[::-1]
Expand Down

0 comments on commit 4eb15f7

Please sign in to comment.