equal
deleted
inserted
replaced
54 |
54 |
55 As we can see we have the same plot but now in red colour. |
55 As we can see we have the same plot but now in red colour. |
56 |
56 |
57 .. #[Madhu: diff again] |
57 .. #[Madhu: diff again] |
58 |
58 |
59 To alter the thickness of the line, we use the =linewidth= argument in the plot |
59 To alter the thickness of the line, we use the ``linewidth`` argument in the plot |
60 command. Hence |
60 command. Hence |
61 :: |
61 :: |
62 |
62 |
63 plot(x, cos(x), linewidth=2) |
63 plot(x, cos(x), linewidth=2) |
64 |
64 |
166 We now have the plot in a colour and linewidth of our interest. As you can see, |
166 We now have the plot in a colour and linewidth of our interest. As you can see, |
167 the figure does not have any description describing the plot. |
167 the figure does not have any description describing the plot. |
168 |
168 |
169 .. #[Madhu: Added "not". See the diff] |
169 .. #[Madhu: Added "not". See the diff] |
170 |
170 |
171 We will now add a title to the plot by using the =title= command. |
171 We will now add a title to the plot by using the ``title`` command. |
172 :: |
172 :: |
173 |
173 |
174 title("Parabolic function -x^2+4x-5") |
174 title("Parabolic function -x^2+4x-5") |
175 |
175 |
176 {{{ Show the plot window and point to the title }}} |
176 {{{ Show the plot window and point to the title }}} |
177 |
177 |
178 The figure now has a title which describes what the plot is. The |
178 The figure now has a title which describes what the plot is. The |
179 =title= command as you can see, takes a string as an argument and sets |
179 ``title`` command as you can see, takes a string as an argument and sets |
180 the title accordingly. |
180 the title accordingly. |
181 |
181 |
182 .. #[Madhu: See the diff] |
182 .. #[Madhu: See the diff] |
183 |
183 |
184 The formatting in title is messed and it does not look clean. You can imagine |
184 The formatting in title is messed and it does not look clean. You can imagine |
223 |
223 |
224 xlabel("x") |
224 xlabel("x") |
225 |
225 |
226 {{{ Switch to plot window and show the xlabel }}} |
226 {{{ Switch to plot window and show the xlabel }}} |
227 |
227 |
228 As you can see, =xlabel= command takes a string as an argument, |
228 As you can see, ``xlabel`` command takes a string as an argument, |
229 similar to the =title= command and sets it as the label to x-axis. |
229 similar to the ``title`` command and sets it as the label to x-axis. |
230 |
230 |
231 .. #[See the diff] |
231 .. #[See the diff] |
232 |
232 |
233 Similarly, |
233 Similarly, |
234 :: |
234 :: |
263 |
263 |
264 annotate("local maxima", xy=(2, -1)) |
264 annotate("local maxima", xy=(2, -1)) |
265 |
265 |
266 {{{ Show the annotation that has appeared on the plot }}} |
266 {{{ Show the annotation that has appeared on the plot }}} |
267 |
267 |
268 As you can see, the first argument to =annotate= command is the name we would |
268 As you can see, the first argument to ``annotate`` command is the name we would |
269 like to mark the point as and the second argument is the co-ordinates of the |
269 like to mark the point as and the second argument is the co-ordinates of the |
270 point at which the name should appear. It is a sequence containing two numbers. |
270 point at which the name should appear. It is a sequence containing two numbers. |
271 The first is x co-ordinate and second is y co-ordinate. |
271 The first is x co-ordinate and second is y co-ordinate. |
272 |
272 |
273 .. #[[Anoop: I think we should tell explicitely that xy takes a |
273 .. #[[Anoop: I think we should tell explicitely that xy takes a |