Show More
@@ -72,7 +72,7 b' class Converter(object):' | |||
|
72 | 72 | if not os.path.isdir(files_dir): |
|
73 | 73 | os.mkdir(files_dir) |
|
74 | 74 | self.infile_root = infile_root |
|
75 |
self.files_dir = |
|
|
75 | self.files_dir = files_dir | |
|
76 | 76 | self.outbase = os.path.join(self.infile_dir, infile_root) |
|
77 | 77 | |
|
78 | 78 | def __del__(self): |
@@ -106,7 +106,7 b" Let's plot both the function and the area below it in the trapezoid approximatio" | |||
|
106 | 106 | |
|
107 | 107 | |
|
108 | 108 | |
|
109 |
![]( |
|
|
109 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.svg) | |
|
110 | 110 | |
|
111 | 111 | |
|
112 | 112 | Compute the integral both at high accuracy and with the trapezoid approximation |
@@ -843,7 +843,7 b' The most frequently used function is simply called `plot`, here is how you can m' | |||
|
843 | 843 | |
|
844 | 844 | |
|
845 | 845 | |
|
846 |
![]( |
|
|
846 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.svg) | |
|
847 | 847 | |
|
848 | 848 | |
|
849 | 849 | You can control the style, color and other properties of the markers, for example: |
@@ -853,7 +853,7 b' You can control the style, color and other properties of the markers, for exampl' | |||
|
853 | 853 | |
|
854 | 854 | |
|
855 | 855 | |
|
856 |
![]( |
|
|
856 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.svg) | |
|
857 | 857 | |
|
858 | 858 | |
|
859 | 859 | <div class="highlight"><pre><span class="n">plt</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="s">'o'</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">'r'</span><span class="p">);</span> |
@@ -861,7 +861,7 b' You can control the style, color and other properties of the markers, for exampl' | |||
|
861 | 861 | |
|
862 | 862 | |
|
863 | 863 | |
|
864 |
![]( |
|
|
864 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.svg) | |
|
865 | 865 | |
|
866 | 866 | |
|
867 | 867 | We will now see how to create a few other common plot types, such as a simple error plot: |
@@ -882,7 +882,7 b' We will now see how to create a few other common plot types, such as a simple er' | |||
|
882 | 882 | |
|
883 | 883 | |
|
884 | 884 | |
|
885 |
![]( |
|
|
885 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.svg) | |
|
886 | 886 | |
|
887 | 887 | |
|
888 | 888 | A simple log plot |
@@ -894,7 +894,7 b' A simple log plot' | |||
|
894 | 894 | |
|
895 | 895 | |
|
896 | 896 | |
|
897 |
![]( |
|
|
897 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.svg) | |
|
898 | 898 | |
|
899 | 899 | |
|
900 | 900 | A histogram annotated with text inside the plot, using the `text` function: |
@@ -916,7 +916,7 b' A histogram annotated with text inside the plot, using the `text` function:' | |||
|
916 | 916 | |
|
917 | 917 | |
|
918 | 918 | |
|
919 |
![]( |
|
|
919 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.svg) | |
|
920 | 920 | |
|
921 | 921 | |
|
922 | 922 | ## Image display |
@@ -929,7 +929,7 b' The `imshow` command can display single or multi-channel images. A simple array' | |||
|
929 | 929 | |
|
930 | 930 | |
|
931 | 931 | |
|
932 |
![]( |
|
|
932 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.svg) | |
|
933 | 933 | |
|
934 | 934 | |
|
935 | 935 | A real photograph is a multichannel image, `imshow` interprets it correctly: |
@@ -943,7 +943,7 b' A real photograph is a multichannel image, `imshow` interprets it correctly:' | |||
|
943 | 943 | Dimensions of the array img: (375, 500, 3) |
|
944 | 944 | |
|
945 | 945 | |
|
946 |
![]( |
|
|
946 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.svg) | |
|
947 | 947 | |
|
948 | 948 | |
|
949 | 949 | ## Simple 3d plotting with matplotlib |
@@ -979,7 +979,7 b' A simple surface plot:' | |||
|
979 | 979 | |
|
980 | 980 | |
|
981 | 981 | |
|
982 |
![]( |
|
|
982 | ![](tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.svg) | |
|
983 | 983 | |
|
984 | 984 | |
|
985 | 985 | # IPython: a powerful interactive environment |
@@ -100,7 +100,7 b" plt.fill_between(xint, 0, yint, facecolor='gray', alpha=0.4)" | |||
|
100 | 100 | plt.text(0.5 * (a + b), 30,r"$\int_a^b f(x)dx$", horizontalalignment='center', fontsize=20); |
|
101 | 101 | |
|
102 | 102 | # Out[3]: |
|
103 |
# image file: |
|
|
103 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.svg | |
|
104 | 104 | |
|
105 | 105 | # Compute the integral both at high accuracy and with the trapezoid approximation |
|
106 | 106 | |
@@ -749,7 +749,7 b" plt.xlabel('x')" | |||
|
749 | 749 | plt.ylabel('y'); |
|
750 | 750 | |
|
751 | 751 | # Out[60]: |
|
752 |
# image file: |
|
|
752 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.svg | |
|
753 | 753 | |
|
754 | 754 | # You can control the style, color and other properties of the markers, for example: |
|
755 | 755 | |
@@ -757,13 +757,13 b" plt.ylabel('y');" | |||
|
757 | 757 | plt.plot(x, y, linewidth=2); |
|
758 | 758 | |
|
759 | 759 | # Out[61]: |
|
760 |
# image file: |
|
|
760 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.svg | |
|
761 | 761 | |
|
762 | 762 | # In[62]: |
|
763 | 763 | plt.plot(x, y, 'o', markersize=5, color='r'); |
|
764 | 764 | |
|
765 | 765 | # Out[62]: |
|
766 |
# image file: |
|
|
766 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.svg | |
|
767 | 767 | |
|
768 | 768 | # We will now see how to create a few other common plot types, such as a simple error plot: |
|
769 | 769 | |
@@ -782,7 +782,7 b' plt.errorbar(x, y, xerr=0.2, yerr=0.4)' | |||
|
782 | 782 | plt.title("Simplest errorbars, 0.2 in x, 0.4 in y"); |
|
783 | 783 | |
|
784 | 784 | # Out[63]: |
|
785 |
# image file: |
|
|
785 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.svg | |
|
786 | 786 | |
|
787 | 787 | # A simple log plot |
|
788 | 788 | |
@@ -792,7 +792,7 b' y = np.exp(-x**2)' | |||
|
792 | 792 | plt.semilogy(x, y); |
|
793 | 793 | |
|
794 | 794 | # Out[64]: |
|
795 |
# image file: |
|
|
795 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.svg | |
|
796 | 796 | |
|
797 | 797 | # A histogram annotated with text inside the plot, using the `text` function: |
|
798 | 798 | |
@@ -812,7 +812,7 b' plt.axis([40, 160, 0, 0.03])' | |||
|
812 | 812 | plt.grid(True) |
|
813 | 813 | |
|
814 | 814 | # Out[65]: |
|
815 |
# image file: |
|
|
815 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.svg | |
|
816 | 816 | |
|
817 | 817 | ### Image display |
|
818 | 818 | |
@@ -823,7 +823,7 b' from matplotlib import cm' | |||
|
823 | 823 | plt.imshow(np.random.rand(5, 10), cmap=cm.gray, interpolation='nearest'); |
|
824 | 824 | |
|
825 | 825 | # Out[66]: |
|
826 |
# image file: |
|
|
826 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.svg | |
|
827 | 827 | |
|
828 | 828 | # A real photograph is a multichannel image, `imshow` interprets it correctly: |
|
829 | 829 | |
@@ -835,7 +835,7 b' plt.imshow(img);' | |||
|
835 | 835 | # Out[67]: |
|
836 | 836 | # Dimensions of the array img: (375, 500, 3) |
|
837 | 837 | # |
|
838 |
# image file: |
|
|
838 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.svg | |
|
839 | 839 | |
|
840 | 840 | ### Simple 3d plotting with matplotlib |
|
841 | 841 | |
@@ -867,7 +867,7 b' surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet,' | |||
|
867 | 867 | ax.set_zlim3d(-1.01, 1.01); |
|
868 | 868 | |
|
869 | 869 | # Out[72]: |
|
870 |
# image file: |
|
|
870 | # image file: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.svg | |
|
871 | 871 | |
|
872 | 872 | ## IPython: a powerful interactive environment |
|
873 | 873 |
@@ -210,7 +210,7 b' In[3]:' | |||
|
210 | 210 | plt.fill_between(xint, 0, yint, facecolor='gray', alpha=0.4) |
|
211 | 211 | plt.text(0.5 * (a + b), 30,r"$\int_a^b f(x)dx$", horizontalalignment='center', fontsize=20); |
|
212 | 212 | |
|
213 |
.. image:: |
|
|
213 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.svg | |
|
214 | 214 | |
|
215 | 215 | Compute the integral both at high accuracy and with the trapezoid |
|
216 | 216 | approximation |
@@ -1328,7 +1328,7 b' In[60]:' | |||
|
1328 | 1328 | plt.xlabel('x') |
|
1329 | 1329 | plt.ylabel('y'); |
|
1330 | 1330 | |
|
1331 |
.. image:: |
|
|
1331 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.svg | |
|
1332 | 1332 | |
|
1333 | 1333 | You can control the style, color and other properties of the markers, |
|
1334 | 1334 | for example: |
@@ -1339,7 +1339,7 b' In[61]:' | |||
|
1339 | 1339 | |
|
1340 | 1340 | plt.plot(x, y, linewidth=2); |
|
1341 | 1341 | |
|
1342 |
.. image:: |
|
|
1342 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.svg | |
|
1343 | 1343 | |
|
1344 | 1344 | In[62]: |
|
1345 | 1345 | |
@@ -1347,7 +1347,7 b' In[62]:' | |||
|
1347 | 1347 | |
|
1348 | 1348 | plt.plot(x, y, 'o', markersize=5, color='r'); |
|
1349 | 1349 | |
|
1350 |
.. image:: |
|
|
1350 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.svg | |
|
1351 | 1351 | |
|
1352 | 1352 | We will now see how to create a few other common plot types, such as a |
|
1353 | 1353 | simple error plot: |
@@ -1369,7 +1369,7 b' In[63]:' | |||
|
1369 | 1369 | plt.errorbar(x, y, xerr=0.2, yerr=0.4) |
|
1370 | 1370 | plt.title("Simplest errorbars, 0.2 in x, 0.4 in y"); |
|
1371 | 1371 | |
|
1372 |
.. image:: |
|
|
1372 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.svg | |
|
1373 | 1373 | |
|
1374 | 1374 | A simple log plot |
|
1375 | 1375 | |
@@ -1381,7 +1381,7 b' In[64]:' | |||
|
1381 | 1381 | y = np.exp(-x**2) |
|
1382 | 1382 | plt.semilogy(x, y); |
|
1383 | 1383 | |
|
1384 |
.. image:: |
|
|
1384 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.svg | |
|
1385 | 1385 | |
|
1386 | 1386 | A histogram annotated with text inside the plot, using the ``text`` |
|
1387 | 1387 | function: |
@@ -1404,7 +1404,7 b' In[65]:' | |||
|
1404 | 1404 | plt.axis([40, 160, 0, 0.03]) |
|
1405 | 1405 | plt.grid(True) |
|
1406 | 1406 | |
|
1407 |
.. image:: |
|
|
1407 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.svg | |
|
1408 | 1408 | |
|
1409 | 1409 | Image display |
|
1410 | 1410 | ------------- |
@@ -1419,7 +1419,7 b' In[66]:' | |||
|
1419 | 1419 | from matplotlib import cm |
|
1420 | 1420 | plt.imshow(np.random.rand(5, 10), cmap=cm.gray, interpolation='nearest'); |
|
1421 | 1421 | |
|
1422 |
.. image:: |
|
|
1422 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.svg | |
|
1423 | 1423 | |
|
1424 | 1424 | A real photograph is a multichannel image, ``imshow`` interprets it |
|
1425 | 1425 | correctly: |
@@ -1437,7 +1437,7 b' In[67]:' | |||
|
1437 | 1437 | Dimensions of the array img: (375, 500, 3) |
|
1438 | 1438 | |
|
1439 | 1439 | |
|
1440 |
.. image:: |
|
|
1440 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.svg | |
|
1441 | 1441 | |
|
1442 | 1442 | Simple 3d plotting with matplotlib |
|
1443 | 1443 | ---------------------------------- |
@@ -1479,7 +1479,7 b' In[72]:' | |||
|
1479 | 1479 | linewidth=0, antialiased=False) |
|
1480 | 1480 | ax.set_zlim3d(-1.01, 1.01); |
|
1481 | 1481 | |
|
1482 |
.. image:: |
|
|
1482 | .. image:: tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.svg | |
|
1483 | 1483 | |
|
1484 | 1484 | IPython: a powerful interactive environment |
|
1485 | 1485 | =========================================== |
@@ -332,7 +332,7 b' plt.text(0.5 * (a + b), 30,r"$\\int_a^b f(x)dx$", horizontalalignment=\'center\', f' | |||
|
332 | 332 | \end{codeinput} |
|
333 | 333 | \begin{codeoutput} |
|
334 | 334 | \begin{center} |
|
335 |
\includegraphics[width=6in]{ |
|
|
335 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_00.pdf} | |
|
336 | 336 | \par |
|
337 | 337 | \end{center} |
|
338 | 338 | \end{codeoutput} |
@@ -1496,7 +1496,7 b" plt.ylabel('y');" | |||
|
1496 | 1496 | \end{codeinput} |
|
1497 | 1497 | \begin{codeoutput} |
|
1498 | 1498 | \begin{center} |
|
1499 |
\includegraphics[width=6in]{ |
|
|
1499 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_01.pdf} | |
|
1500 | 1500 | \par |
|
1501 | 1501 | \end{center} |
|
1502 | 1502 | \end{codeoutput} |
@@ -1512,7 +1512,7 b' plt.plot(x, y, linewidth=2);' | |||
|
1512 | 1512 | \end{codeinput} |
|
1513 | 1513 | \begin{codeoutput} |
|
1514 | 1514 | \begin{center} |
|
1515 |
\includegraphics[width=6in]{ |
|
|
1515 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_02.pdf} | |
|
1516 | 1516 | \par |
|
1517 | 1517 | \end{center} |
|
1518 | 1518 | \end{codeoutput} |
@@ -1525,7 +1525,7 b" plt.plot(x, y, 'o', markersize=5, color='r');" | |||
|
1525 | 1525 | \end{codeinput} |
|
1526 | 1526 | \begin{codeoutput} |
|
1527 | 1527 | \begin{center} |
|
1528 |
\includegraphics[width=6in]{ |
|
|
1528 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_03.pdf} | |
|
1529 | 1529 | \par |
|
1530 | 1530 | \end{center} |
|
1531 | 1531 | \end{codeoutput} |
@@ -1552,7 +1552,7 b' plt.title("Simplest errorbars, 0.2 in x, 0.4 in y");' | |||
|
1552 | 1552 | \end{codeinput} |
|
1553 | 1553 | \begin{codeoutput} |
|
1554 | 1554 | \begin{center} |
|
1555 |
\includegraphics[width=6in]{ |
|
|
1555 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_04.pdf} | |
|
1556 | 1556 | \par |
|
1557 | 1557 | \end{center} |
|
1558 | 1558 | \end{codeoutput} |
@@ -1569,7 +1569,7 b' plt.semilogy(x, y);' | |||
|
1569 | 1569 | \end{codeinput} |
|
1570 | 1570 | \begin{codeoutput} |
|
1571 | 1571 | \begin{center} |
|
1572 |
\includegraphics[width=6in]{ |
|
|
1572 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_05.pdf} | |
|
1573 | 1573 | \par |
|
1574 | 1574 | \end{center} |
|
1575 | 1575 | \end{codeoutput} |
@@ -1597,7 +1597,7 b' plt.grid(True)' | |||
|
1597 | 1597 | \end{codeinput} |
|
1598 | 1598 | \begin{codeoutput} |
|
1599 | 1599 | \begin{center} |
|
1600 |
\includegraphics[width=6in]{ |
|
|
1600 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_06.pdf} | |
|
1601 | 1601 | \par |
|
1602 | 1602 | \end{center} |
|
1603 | 1603 | \end{codeoutput} |
@@ -1615,7 +1615,7 b" plt.imshow(np.random.rand(5, 10), cmap=cm.gray, interpolation='nearest');" | |||
|
1615 | 1615 | \end{codeinput} |
|
1616 | 1616 | \begin{codeoutput} |
|
1617 | 1617 | \begin{center} |
|
1618 |
\includegraphics[width=6in]{ |
|
|
1618 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_07.pdf} | |
|
1619 | 1619 | \par |
|
1620 | 1620 | \end{center} |
|
1621 | 1621 | \end{codeoutput} |
@@ -1636,7 +1636,7 b' plt.imshow(img);' | |||
|
1636 | 1636 | Dimensions of the array img: (375, 500, 3) |
|
1637 | 1637 | \end{verbatim} |
|
1638 | 1638 | \begin{center} |
|
1639 |
\includegraphics[width=6in]{ |
|
|
1639 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_08.pdf} | |
|
1640 | 1640 | \par |
|
1641 | 1641 | \end{center} |
|
1642 | 1642 | \end{codeoutput} |
@@ -1682,7 +1682,7 b' ax.set_zlim3d(-1.01, 1.01);' | |||
|
1682 | 1682 | \end{codeinput} |
|
1683 | 1683 | \begin{codeoutput} |
|
1684 | 1684 | \begin{center} |
|
1685 |
\includegraphics[width=6in]{ |
|
|
1685 | \includegraphics[width=6in]{tests/ipynbref/IntroNumPy.orig_files/IntroNumPy.orig_fig_09.pdf} | |
|
1686 | 1686 | \par |
|
1687 | 1687 | \end{center} |
|
1688 | 1688 | \end{codeoutput} |
General Comments 0
You need to be logged in to leave comments.
Login now