Skip to content

Commit ee74766

Browse files
committedDec 13, 2023
Docstrings for examples/requirements
1 parent 988298e commit ee74766

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed
 

Diff for: ‎examples/scatter_with_custom_axes.py

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
"""
2+
=========================================
3+
An simple scatter plot using `ax.scatter`
4+
=========================================
5+
6+
This is a quick comparison between the current Matplotlib `scatter` and
7+
the version in :file:`data_prototype/axes.py`, which uses data containers
8+
and a conversion pipeline.
9+
10+
This is here to show what does work and what does not work with the current
11+
implementation of container-based artist drawing.
12+
"""
13+
14+
115
import data_prototype.axes # side-effect registers projection # noqa
216

317
import matplotlib.pyplot as plt

Diff for: ‎examples/units.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
"""
2-
==================================================
3-
An simple scatter plot using PathCollectionWrapper
4-
==================================================
2+
===========================================
3+
Using pint units with PathCollectionWrapper
4+
===========================================
55
6-
A quick scatter plot using :class:`.containers.ArrayContainer` and
7-
:class:`.wrappers.PathCollectionWrapper`.
6+
Using third party units functionality in conjunction with Matplotlib Axes
87
"""
98
import numpy as np
109

@@ -35,6 +34,10 @@
3534
fig, ax = plt.subplots()
3635
ax.set_xlim(-0.5, 7)
3736
ax.set_ylim(0, 5)
37+
38+
# DelayedConversionNode is used to identify the keys which undergo unit transformations
39+
# The actual method which does conversions in this example is added by the
40+
# `Axis`/`Axes`, but `PathCollectionWrapper` does not natively interact with the units.
3841
xconv = DelayedConversionNode.from_keys(("x",), converter_key="xunits")
3942
yconv = DelayedConversionNode.from_keys(("y",), converter_key="yunits")
4043
lw = PathCollectionWrapper(cont, [xconv, yconv], offset_transform=ax.transData)

Diff for: ‎requirements-doc.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ sphinx-copybutton
77
sphinx-gallery
88
ipython
99
scikit-image
10+
pint

0 commit comments

Comments
 (0)