basic-plot.txt
changeset 17 4ec2ba3d96f5
parent 16 cdcad776b360
child 18 27ba96db9d12
equal deleted inserted replaced
16:cdcad776b360 17:4ec2ba3d96f5
   160 In []: close()
   160 In []: close()
   161 
   161 
   162 close() now closes the figure(2).
   162 close() now closes the figure(2).
   163 In []: close()
   163 In []: close()
   164 
   164 
   165 The plot command takes the  parameters such as 'g' which generates the plot in green color. 
   165 The plot command can take the  parameters such as 'g' which generates the plot in green color. 
   166 
   166 
   167 Passing the linewidth=2 option to plot, generates the plot with linewidth of two units.
   167 Passing the linewidth=2 option to plot, generates the plot with linewidth of two units.
   168 Use Up arrow to get to the previous commands 
   168 Use Up arrow to get to the previous commands 
   169 In []: plot(x, sin(x), 'g', linewidth=2) and add arguments
   169 In []: plot(x, sin(x), 'g', linewidth=2) and add arguments
   170 
   170 
   173 In order to plot points you may pass '.' as a parameter to plot
   173 In order to plot points you may pass '.' as a parameter to plot
   174 In []: plot(x, sin(x), '.')
   174 In []: plot(x, sin(x), '.')
   175 
   175 
   176 In []: clf()
   176 In []: clf()
   177 
   177 
   178 In order to plot filled circles in black color you can pass 'ko' parameter to plot
       
   179 In []: plot(x, cos(x), 'ko')
       
   180 
       
   181 In []: clf()
       
   182 
       
   183 A plot using dashed lines can be generated by passing the '--' parameter
       
   184 In []: plot(x, sin(x), '--')
       
   185 
   178 
   186 You may look at more options related to colors and type of lines using plot?(question mark)
   179 You may look at more options related to colors and type of lines using plot?(question mark)
       
   180 
       
   181 quit the documentation using Plot.
   187 
   182 
   188 In []: clf()
   183 In []: clf()
   189 
   184 
   190 and finally to close the plot
   185 and finally to close the plot
   191 In []: close()
   186 In []: close()
   192 
   187 
   193 
   188 In this tutorial You learned 
       
   189 
       
   190 Ipython Features
       
   191 Tab for autocompletion.
       
   192 function? to look at documention
       
   193 q to quit documentation.
       
   194 escapping from ... prompt using Ctrl -C
       
   195 quitting ipython using Ctrl-D
       
   196 
       
   197 The functions and commands you learnt were :
       
   198 print for outping things
       
   199 linspace to create equally space points
       
   200 plot to get a plot
       
   201 xlabel to label x-axis of plot
       
   202 ylabel to label y-axis of plot
       
   203 title to title a plot
       
   204 legend for placing  appropriate legend
       
   205 annotating a plot
       
   206 saving a plot
       
   207 multiple plots using figure
       
   208 clearing plots using clf()
       
   209 and last closing plot using close()
   194 
   210 
   195 
   211 
   196 ****************
   212 ****************
   197 This brings us to the end of this tutorial.  Thank you for attending this first tutorial on Python for Scientific Computing 
   213 This brings us to the end of this tutorial.  Thank you for attending this on Python for Scientific Computing .Hope you enjoyed it and found it useful.
   198 ****************
   214 ****************