Introduction to matplotlib
Graphs and other visual representations have become more important in explaining many complex financial concepts, trading strategies, and formulas.
In this section, we discuss the matplotlib
module, which is used to create various types of graphs. In addition, the module will be used intensively in Chapter 10, Options and Futures, when we discuss the famous Black-Scholes-Merton option model and various trading strategies. The matplotlib
module is designed to produce publication-quality figures and graphs. The matplotlib
module depends on NumPy and SciPy, which were discussed in the previous sections. To save generated graphs, there are several output formats available, such as PDF, Postscript, SVG, and PNG.
How to install matplotlib
If Python was installed by using the Anaconda super package, then matplotlib
is preinstalled already. After launching Spyder, type the following line to test. If there is no error, it means that we have imported/uploaded the module successfully...