Skip to content

Commit 54c9bba

Browse files
committed
Minor docs cleanup
1 parent c7a9fc9 commit 54c9bba

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

HOWTOCONTRIBUTE.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ Write tests
4040

4141
Most modern python packages have ``test_*.py`` scripts that are run by `pytest`
4242
via the `Travis Continuous Integration <https://travis-ci.com>`__ service
43-
whenever commits are pushed to the repository. Currently, proplot only tests
44-
the examples that appear on the website User Guide (see `.travis.yml`). While we
45-
try to make the examples comprehensive, this approach leaves out a lot of use
46-
cases and leaves the project more vulnerable to bugs. Adding tests is a
47-
*critical* item on our to-do list.
43+
whenever commits are pushed to the repository. Currently, automatic testing only
44+
includes the examples that appear on the website User Guide (see `.travis.yml`),
45+
and `Luke Davis <https://github.com/lukelbd>` runs additional tests manually on
46+
his machine. This approach leaves out many use cases and leaves the project more
47+
vulnerable to bugs. Adding tests is a *critical* item on our to-do list.
4848

4949
If you can think of a useful test for proplot, feel free to submit a pull request.
5050
Your test will be used in the future.

docs/colorbars_legends.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
# Outer and inset locations
3232
# -------------------------
3333
#
34-
# Matplotlib supports drawing "inset" legends and "outer" colorbars using
35-
# the `loc` and `location` keyword arguments. However, "outer" legends are
36-
# only posssible using the somewhat counterintuitive `bbox_to_anchor` keyword
37-
# (see `this stackoverflow post <https://stackoverflow.com/q/4700614/4970632>`__)
34+
# Matplotlib supports drawing "inset" legends and "outer" colorbars using the `loc`
35+
# and `location` keyword arguments. However, "outer" legends are only posssible using
36+
# the somewhat counterintuitive `bbox_to_anchor` keyword (see `here
37+
# <https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html#legend-location>`__)
3838
# and "inset" colorbars are not possible without manually creating and positioning
3939
# the associated axes. Proplot tries to improve this behavior:
4040
#
@@ -54,6 +54,7 @@
5454
# (e.g., ``loc='upper right'`` or the shorthand ``loc='ur'``). Inset
5555
# colorbars have optional background "frames" that can be configured
5656
# with various `~proplot.axes.Axes.colorbar` keywords.
57+
# * Outer colorbars and legends can be aligned using the `align` keyword.
5758

5859
# `~proplot.axes.Axes.colorbar` and `~proplot.axes.Axes.legend` also both accept
5960
# `space` and `pad` keywords. `space` controls the absolute separation of the
@@ -139,13 +140,13 @@
139140
data = (state.rand(30, 10) - 0.5).cumsum(axis=0)
140141
ax = fig.subplot(121, title='On-the-fly legend')
141142
ax.plot( # add all at once
142-
data[:, :5], lw=2, cycle='Blues1', cycle_kw={'ls': ('-', '--'), 'left': 0.1},
143-
labels=labels, legend='l', legend_kw={'frame': False, 'ncols': 1}
143+
data[:, :5], lw=2, cycle='Reds1', cycle_kw={'ls': ('-', '--'), 'left': 0.1},
144+
labels=labels, legend='b', legend_kw={'title': 'legend title'}
144145
)
145146
for i in range(5):
146147
ax.plot( # add one-by-one
147-
data[:, 5 + i], lw=2, cycle='Reds1', cycle_kw={'ls': ('-', '--'), 'left': 0.1},
148-
label=labels[i], legend='b', legend_kw={'title': 'legend title'},
148+
data[:, 5 + i], label=labels[i], linewidth=2,
149+
cycle='Blues1', cycle_kw={'N': 5, 'ls': ('-', '--'), 'left': 0.1},
149150
colorbar='ul', colorbar_kw={'label': 'colorbar from lines'}
150151
)
151152

@@ -157,9 +158,8 @@
157158
colorbar_kw={'length': 0.8, 'label': 'colorbar label'},
158159
)
159160
ax.contour(
160-
data, cmap='Mono_r', cmap_kw={'left': 0.05}, lw=1.5,
161-
colorbar='r', colorbar_kw={'label': 'colorbar label', 'length': 0.7},
162-
label='contour', legend='ul', legend_kw={'label': 'legend from mappable'},
161+
data, color='gray7', lw=1.5,
162+
label='contour', legend='ul', legend_kw={'label': 'legend from contours'},
163163
)
164164

165165
# %%

0 commit comments

Comments
 (0)