Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aaabc2a

Browse files
committed
added chipy talk video and some notes about transforms
svn path=/branches/v1_0_maint/; revision=8754
1 parent 76d1396 commit aaabc2a

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

doc/_templates/indexsidebar.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ <h3>Videos</h3>
2727
<p>Watch the <a href="http://conference.scipy.org/">SciPy</a> 2009 <a href="http://www.archive.org/details/scipy09_introTutorialDay2_1">intro</a> and <a href="http://www.archive.org/details/scipy09_advancedTutorialDay1_3">advanced</a> matplotlib tutorials
2828
</p>
2929

30-
<p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">talk</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>MLOSS</i></a>.
30+
<p>Watch
31+
a <a href="http://videolectures.net/mloss08_hunter_mat">talk</a> about
32+
matplotlib presented
33+
at <a href="http://videolectures.net/mloss08_whistler">NIPS 08
34+
Workshop</a> <i>MLOSS</i></a> and one <a href="http://carlfk.blip.tv/file/2557425">presented</a>
35+
at <a href="http://chipy.org">ChiPy</a>.
3136
</p>
3237

3338

doc/users/transforms_tutorial.rst

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,27 @@ inseparable transformations like the
261261

262262
plt.show()
263263

264+
.. note::
265+
266+
The blended transformations where x is in data coords and y in axes
267+
coordinates is so useful that we have helper methods to return the
268+
versions mpl uses internally for drawing ticks, ticklabels, etc.
269+
The methods are :meth:`matplotlib.axes.Axes.get_xaxis_transform` and
270+
:meth:`matplotlib.axes.Axes.get_yaxis_transform`. So in the example
271+
above, the call to
272+
:meth:`~matplotlib.transforms.blended_transform_factory` can be
273+
replaced by ``get_xaxis_transform``::
274+
275+
trans = ax.get_xaxis_transform()
264276

265277
.. offset-transforms-shadow:
266278
267279
Using offset transforms to create a shadow effect
268280
=================================================
269281

270282
One use of transformations is to create a new transformation that is
271-
offset from another annotation, eg to place one object shifted a bit
272-
relative to another object. Typically you want the shift to be in
283+
offset from another transformation, eg to place one object shifted a
284+
bit relative to another object. Typically you want the shift to be in
273285
some physical dimension, like points or inches rather than in data
274286
coordinates, so that the shift effect is constant at different zoom
275287
levels and dpi settings.
@@ -301,8 +313,11 @@ operator in::
301313
shadow_transform = ax.transData + offset
302314

303315
showing that can chain transformations using the addition operator.
304-
This code says: first apply the data transformation ``ax.transData`` and
305-
then translate the data by `dx` and `dy` points.
316+
This code says: first apply the data transformation ``ax.transData``
317+
and then translate the data by `dx` and `dy` points. In typography,
318+
a`point <http://en.wikipedia.org/wiki/Point_%28typography%29>`_ is
319+
1/72 inches, and by specifying your offsets in points, your figure
320+
will look the same regardless of the dpi resolution it is saved in.
306321

307322
.. plot::
308323
:include-source:

0 commit comments

Comments
 (0)