|
From: <jd...@us...> - 2008-06-10 13:57:13
|
Revision: 5457
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5457&view=rev
Author: jdh2358
Date: 2008-06-10 06:57:12 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
added a text example
Added Paths:
-----------
trunk/matplotlib/doc/users/figures/text_commands.py
Added: trunk/matplotlib/doc/users/figures/text_commands.py
===================================================================
--- trunk/matplotlib/doc/users/figures/text_commands.py (rev 0)
+++ trunk/matplotlib/doc/users/figures/text_commands.py 2008-06-10 13:57:12 UTC (rev 5457)
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+fig.suptitle('bold figure suptitle', fontsize=14, fontweight='bold')
+
+ax = fig.add_subplot(111)
+
+ax.set_title('axes title')
+
+ax.set_xlabel('xlabel')
+ax.set_ylabel('ylabel')
+ax.text(5, 8, 'italics text in data coords', style='italic')
+ax.text(2, 6, r'an equation: $E=mc^2$', fontsize=20)
+
+ax.text(0.95, 0.01, 'text in axes coords',
+ verticalalignment='bottom', horizontalalignment='right',
+ transform=ax.transAxes,
+ color='green', fontsize=20)
+
+
+ax.plot([2], [1], 'o')
+ax.annotate('annotate', xy=(2, 1), xytext=(3, 4),
+ arrowprops=dict(facecolor='black', shrink=0.05))
+
+ax.axis([0, 10, 0, 10])
+
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|