Show More
@@ -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 |
![](tests/ipynbref/IntroNumPy |
|
109 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_00.svg) | |
110 |
|
110 | |||
111 |
|
111 | |||
112 | Compute the integral both at high accuracy and with the trapezoid approximation |
|
112 | Compute the integral both at high accuracy and with the trapezoid approximation | |
@@ -498,7 +498,7 b' For these methods, the above operations area all computed on all the elements of' | |||||
498 | The sum of elements along the columns is : [ 4 6 8 10] |
|
498 | The sum of elements along the columns is : [ 4 6 8 10] | |
499 |
|
499 | |||
500 |
|
500 | |||
501 |
As you can see in this example, the value of the `axis` parameter is the dimension which will be *consumed* once the operation has been carried out. This is why to sum along the rows we use `axis=0`. |
|
501 | As you can see in this example, the value of the `axis` parameter is the dimension which will be *consumed* once the operation has been carried out. This is why to sum along the rows we use `axis=0`. | |
502 |
|
502 | |||
503 | This can be easily illustrated with an example that has more dimensions; we create an array with 4 dimensions and shape `(3,4,5,6)` and sum along the axis number 2 (i.e. the *third* axis, since in Python all counts are 0-based). That consumes the dimension whose length was 5, leaving us with a new array that has shape `(3,4,6)`: |
|
503 | This can be easily illustrated with an example that has more dimensions; we create an array with 4 dimensions and shape `(3,4,5,6)` and sum along the axis number 2 (i.e. the *third* axis, since in Python all counts are 0-based). That consumes the dimension whose length was 5, leaving us with a new array that has shape `(3,4,6)`: | |
504 |
|
504 | |||
@@ -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 |
![](tests/ipynbref/IntroNumPy |
|
846 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_01.svg) | |
847 |
|
847 | |||
848 |
|
848 | |||
849 | You can control the style, color and other properties of the markers, for example: |
|
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 |
![](tests/ipynbref/IntroNumPy |
|
856 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_02.svg) | |
857 |
|
857 | |||
858 |
|
858 | |||
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> |
|
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 |
![](tests/ipynbref/IntroNumPy |
|
864 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_03.svg) | |
865 |
|
865 | |||
866 |
|
866 | |||
867 | We will now see how to create a few other common plot types, such as a simple error plot: |
|
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 |
![](tests/ipynbref/IntroNumPy |
|
885 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_04.svg) | |
886 |
|
886 | |||
887 |
|
887 | |||
888 | A simple log plot |
|
888 | A simple log plot | |
@@ -894,7 +894,7 b' A simple log plot' | |||||
894 |
|
894 | |||
895 |
|
895 | |||
896 |
|
896 | |||
897 |
![](tests/ipynbref/IntroNumPy |
|
897 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_05.svg) | |
898 |
|
898 | |||
899 |
|
899 | |||
900 | A histogram annotated with text inside the plot, using the `text` function: |
|
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 |
![](tests/ipynbref/IntroNumPy |
|
919 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_06.svg) | |
920 |
|
920 | |||
921 |
|
921 | |||
922 | ## Image display |
|
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 |
![](tests/ipynbref/IntroNumPy |
|
932 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_07.svg) | |
933 |
|
933 | |||
934 |
|
934 | |||
935 | A real photograph is a multichannel image, `imshow` interprets it correctly: |
|
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 | Dimensions of the array img: (375, 500, 3) |
|
943 | Dimensions of the array img: (375, 500, 3) | |
944 |
|
944 | |||
945 |
|
945 | |||
946 |
![](tests/ipynbref/IntroNumPy |
|
946 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_08.svg) | |
947 |
|
947 | |||
948 |
|
948 | |||
949 | ## Simple 3d plotting with matplotlib |
|
949 | ## Simple 3d plotting with matplotlib | |
@@ -979,7 +979,7 b' A simple surface plot:' | |||||
979 |
|
979 | |||
980 |
|
980 | |||
981 |
|
981 | |||
982 |
![](tests/ipynbref/IntroNumPy |
|
982 | ![](tests/ipynbref/IntroNumPy_orig_files/IntroNumPy_orig_fig_09.svg) | |
983 |
|
983 | |||
984 |
|
984 | |||
985 | # IPython: a powerful interactive environment |
|
985 | # IPython: a powerful interactive environment |
General Comments 0
You need to be logged in to leave comments.
Login now