Matplotlib - A Fantastic Plotting Module in Python
Categories: Tech | Pubby Cash Received:
I have been using a variety of plotting software for research and engineering drawing purposes, which include excel spreadsheet, sigmaplot, origin, minitab, matlab, and autoCAD. While studying matplotlib recently, I find it is time to switch to this module with python. It is so powerful that all plot details can be customized. For my applications, I need a plotting tool with the following features:
(1) Linear regression. Matplotlib overkills it by possessing machine learning algorithms with a scikit-learn module. For linear regression, use from sklearn.linear_model import LinearRegression
(2) Dual axis
(3) Multiple plots in one figure; the canvas size of the figure can be defined; the canvas size of each plot in it can be defined as well.
(4) Axis break
(5) Customized error bars
(6) Easy formatting of fonts, legend, axis scales, ticks and labels. With coding, no hand-formatting is needed like I did in excel spreadsheet before.
(7) Easy labeling with text, annotating with arrows, and drawing additional horizontal and vertical lines
(8) Inclusion of superscript, subscript, and special characters such as greek letter mu in axis labels
(9) Easy export as high DPI figure while the file size is still small. This is perfect for journal submissions.
The following plot is a sample I just created as a showcase how powerful it is to satisfy my above-mentioned needs.
Published from: Pennsylvania US
Liked by: Andy Tang, Evan Tang, fnfOzvSR