But the more custom you want it to look, the more time it takes. Matplotlib gives you a lot of power to customize plots. ylabel( 'Word Occurence (% of published works)') title( 'Relative Occurance of Terms in Books Over Time') plot( years, information_age, c = 'blue', linewidth = 3, label = 'Information Age') plot( years, space_age, c = 'red', linewidth = 3, label = 'Space Age') plot( years, machine_age, c = 'green', linewidth = 3, label = 'Machine Age') Information_age /= 1.0e6 # making customized triple-plot from matplotlib import pyplot as plt plt. Space_age /= 1.0e6 information_age = array() # data taking from Google Ngram Viewer from numpy import array, arange years = arange( 1920, 2011, 5) Anaconda is Python packaged with hundreds of tools and libraries that you will want (This includes matplotlib and everything else we will use in this course.) Outlineįirst, let's generate a few random numpy arrays: AnacondaĬonsider installing Anaconda instead. For Windows, pre-built installers are provided. For Linux and Mac, the installation is merely a single line of apt-get. Please check the official SciPy Stack Install Guide. Like most of the libraries used in our "special topics" lectures, matplotlib does not come standard with Python and will have to be installed. Matplotlib allows for a dizzying amount of customization, so you can create anything from quick-and-easy plots to publication-quality plots. The plots are easy to make and easy to customize. Instead, this introduction will show you how to make four major types of plots that you (as a scientist/engineer) will want to know how to make. This lecture will not be a through guide to matplotlib, because that would take far too long. That is, people use it all the time to make 2D or 3D informational graphics. Matplotlib is a standard plotting library in Python.
0 Comments
Leave a Reply. |