SourceForge logo
SourceForge logo
Menu

matplotlib-checkins

From: <jd...@us...> - 2009年08月11日 18:01:10
Revision: 7472
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7472&view=rev
Author: jdh2358
Date: 2009年08月11日 18:01:00 +0000 (2009年8月11日)
Log Message:
-----------
more examples on how to use the extensions
Modified Paths:
--------------
 trunk/sampledoc_tut/extensions.rst
Modified: trunk/sampledoc_tut/extensions.rst
===================================================================
--- trunk/sampledoc_tut/extensions.rst	2009年08月11日 12:41:05 UTC (rev 7471)
+++ trunk/sampledoc_tut/extensions.rst	2009年08月11日 18:01:00 UTC (rev 7472)
@@ -61,8 +61,22 @@
 ================
 
 Michael Droettboom contributed a sphinx extension which does pygments
-syntax highlighting on ipython sessions
+syntax highlighting on ipython sessions. Just use ipython as the
+language in the sourcecode directive::
 
+ .. sourcecode:: ipython
+
+ In [69]: lines = plot([1,2,3])
+
+ In [70]: setp(lines)
+ alpha: float
+ animated: [True | False]
+ antialiased or aa: [True | False]
+ ...snip
+
+
+and you will get the syntax highlighted output below.
+
 .. sourcecode:: ipython
 
 In [69]: lines = plot([1,2,3])
@@ -88,6 +102,19 @@
 
 W^{3\beta}_{\delta_1 \rho_1 \sigma_2} = U^{3\beta}_{\delta_1 \rho_1} + \frac{1}{8 \pi 2} \int^{\alpha_2}_{\alpha_2} d \alpha^\prime_2 \left[\frac{ U^{2\beta}_{\delta_1 \rho_1} - \alpha^\prime_2U^{1\beta}_{\rho_1 \sigma_2} }{U^{0\beta}_{\rho_1 \sigma_2}}\right]
 
+To include math in your document, just use the math directive; here is
+a simpler equation::
+
+ .. math::
+
+ W^{3\beta}_{\delta_1 \rho_1 \sigma_2} \approx U^{3\beta}_{\delta_1 \rho_1} 
+
+which is rendered as 
+
+.. math::
+
+ W^{3\beta}_{\delta_1 \rho_1 \sigma_2} \approx U^{3\beta}_{\delta_1 \rho_1} 
+
 This documentation framework includes a Sphinx extension,
 :file:`sphinxext/mathmpl.py`, that uses matplotlib to render math
 equations when generating HTML, and LaTeX itself when generating a
@@ -108,7 +135,7 @@
 All three of these options for math are designed to behave in the same
 way.
 
-.. _emacs-helpers:
+.. _pyplots:
 
 Inserting matplotlib plots
 ==========================
@@ -128,6 +155,35 @@
 .. plot:: pyplots/ellipses.py
 :include-source:
 
+
+You can also inline simple plots, and the code will be executed at
+documentation build time and the figure inserted into your docs; the
+following code::
+
+ .. plot::
+
+ import matplotlib.pyplot as plt
+ import numpy as np
+ x = np.random.randn(1000)
+ plt.hist( x, 20)
+ plt.grid()
+ plt.title(r'Normal: $\mu=%.2f, \sigma=%.2f$'%(x.mean(), x.std()))
+ plt.show()
+
+produces this output:
+
+.. plot::
+
+ import matplotlib.pyplot as plt
+ import numpy as np
+ x = np.random.randn(1000)
+ plt.hist( x, 20)
+ plt.grid()
+ plt.title(r'Normal: $\mu=%.2f, \sigma=%.2f$'%(x.mean(), x.std()))
+ plt.show()
+
+
+ 
 Inheritance diagrams
 ====================
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <fer...@us...> - 2010年12月13日 16:13:41
Revision: 8834
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8834&view=rev
Author: fer_perez
Date: 2010年12月13日 16:13:35 +0000 (2010年12月13日)
Log Message:
-----------
Fix typo
Modified Paths:
--------------
 trunk/sampledoc_tut/extensions.rst
Modified: trunk/sampledoc_tut/extensions.rst
===================================================================
--- trunk/sampledoc_tut/extensions.rst	2010年12月13日 15:55:06 UTC (rev 8833)
+++ trunk/sampledoc_tut/extensions.rst	2010年12月13日 16:13:35 UTC (rev 8834)
@@ -1,5 +1,4 @@
 .. _extensions:
-<
 
 ****************************************************
 Sphinx extensions for embedded plots, math and more
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /