X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions examples/units/artist_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Artist tests
============

Test unit support with each of the matplotlib primitive artist types
Test unit support with each of the Matplotlib primitive artist types.

The axes handles unit conversions and the artists keep a pointer to
their axes parent, so you must init the artists with the axes instance
if you want to initialize them with unit data, or else they will not
know how to convert the units to scalars.
The axis handles unit conversions and the artists keep a pointer to their axis
parent. You must initialize the artists with the axis instance if you want to
use them with unit data, or else they will not know how to convert the units
to scalars.
"""
import random
import matplotlib.lines as lines
Expand Down Expand Up @@ -38,15 +38,15 @@
ax.add_collection(lc)

# test a plain-ol-line
line = lines.Line2D(
[0*cm, 1.5*cm], [0*cm, 2.5*cm], lw=2, color='black', axes=ax)
line = lines.Line2D([0*cm, 1.5*cm], [0*cm, 2.5*cm],
lw=2, color='black', axes=ax)
ax.add_line(line)

if 0:
# test a patch
# Not supported at present.
rect = patches.Rectangle(
(1*cm, 1*cm), width=5*cm, height=2*cm, alpha=0.2, axes=ax)
rect = patches.Rectangle((1*cm, 1*cm), width=5*cm, height=2*cm,
alpha=0.2, axes=ax)
ax.add_patch(rect)


Expand Down
11 changes: 5 additions & 6 deletions examples/units/bar_demo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
Bar demo with units
===================

plot using a variety of cm vs inches conversions. The example shows
how default unit instrospection works (ax1), how various keywords can
be used to set the x and y units to override the defaults (ax2, ax3,
ax4) and how one can set the xlimits using scalars (ax3, current units
assumed) or units (conversions applied to get the numbers to current
units)
A plot using a variety of centimetre and inch conversions. This example shows
how default unit introspection works (ax1), how various keywords can be used to
set the x and y units to override the defaults (ax2, ax3, ax4) and how one can
set the xlimits using scalars (ax3, current units assumed) or units
(conversions applied to get the numbers to current units).

"""
import numpy as np
Expand Down
3 changes: 2 additions & 1 deletion examples/units/radian_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Radian ticks
============

Plot with radians from the basic_units mockup example package
Plot with radians from the basic_units mockup example package.

This example shows how the unit class can determine the tick locating,
formatting and axis labeling.
"""
Expand Down
X Tutup