equal
deleted
inserted
replaced
16 .. #. loading data from files |
16 .. #. loading data from files |
17 .. #. plotting the data |
17 .. #. plotting the data |
18 |
18 |
19 |
19 |
20 .. Author : Anoop Jacob Thomas <anoop@fossee.in> |
20 .. Author : Anoop Jacob Thomas <anoop@fossee.in> |
21 Internal Reviewer : |
21 Internal Reviewer : Puneeth |
22 External Reviewer : |
22 External Reviewer : |
23 Checklist OK? : <put date stamp here, if OK> [2010-10-05] |
23 Checklist OK? : <put date stamp here, if OK> [2010-10-05] |
24 |
24 |
25 .. #[Puneeth: Quickref missing] |
25 .. #[Puneeth: Quickref missing] |
26 |
26 |
38 |
38 |
39 .. #[Puneeth: motivate looking at other plots. Why are we looking at |
39 .. #[Puneeth: motivate looking at other plots. Why are we looking at |
40 .. them? Tell that we have only looked at one type of plot all the |
40 .. them? Tell that we have only looked at one type of plot all the |
41 .. while, etc.] |
41 .. while, etc.] |
42 |
42 |
43 In this tutorial we will cover scatter plot, pie chart, bar chart and |
43 Till now we have seen only one type of plot, and in this tutorial us |
44 log-log plot. We will also see few other plots and also introduce you to |
44 see more type of plots like scatter plot, pie chart, bar chart and |
45 the matplotlib help. |
45 log-log plot. We will see few other more plots and also see an |
|
46 introduction to matplotlib help. |
46 |
47 |
47 .. #[Puneeth: cover, see and introduce you. be consistent. does, the |
48 .. #[Puneeth: cover, see and introduce you. be consistent. does, the |
48 .. "We" include the viewer or not?] |
49 .. "We" include the viewer or not?] |
49 |
50 |
50 Let us start with scatter plot. |
51 Let us start with scatter plot. |
85 and it can be done as :: |
86 and it can be done as :: |
86 |
87 |
87 year,profit = |
88 year,profit = |
88 loadtxt('/home/fossee/other-plot/company-a-data.txt',dtype=type(int())) |
89 loadtxt('/home/fossee/other-plot/company-a-data.txt',dtype=type(int())) |
89 |
90 |
|
91 By default loadtxt converts the value to float. The |
|
92 ``dtype=type(int())`` argument in loadtxt converts the value to |
|
93 integer as we require the data as integer further in the tutorial. |
|
94 |
90 .. #[Puneeth: make a remark about dtype, that has not been covered in |
95 .. #[Puneeth: make a remark about dtype, that has not been covered in |
91 .. the loadtxt tutorial.] |
96 .. the loadtxt tutorial.] |
92 |
97 |
93 {{{ switch to next slide, ``scatter`` function }}} |
98 {{{ switch to next slide, ``scatter`` function }}} |
94 |
99 |
112 |
117 |
113 Pause here and solve the question before moving on. |
118 Pause here and solve the question before moving on. |
114 |
119 |
115 .. scatter(year,profit,color='r',marker='d') |
120 .. scatter(year,profit,color='r',marker='d') |
116 |
121 |
117 Now let us move on to pie chart. |
122 Now let us see another plot, pie chart and try to plot the same data |
|
123 as a pie chart. |
118 |
124 |
119 .. #[Puneeth: instead of just saying that, say that let's plot a pie |
125 .. #[Puneeth: instead of just saying that, say that let's plot a pie |
120 .. chart for the same data. continuity, will be good.] |
126 .. chart for the same data. continuity, will be good.] |
121 |
127 |
122 {{{ switch to the slide which says about pie chart }}} |
128 {{{ switch to the slide which says about pie chart }}} |