Matplotlib: Difference between revisions

Content deleted Content added
none of these toolkits were notable and the base reference given was a primary source
Remove entirely unsourced section and somewhat arbitrary gallery that was way too big. The examples in the infobox image are plenty
Line 39:
==Comparison with MATLAB==
Pyplot is a Matplotlib module that provides a MATLAB-like interface.<ref>{{Cite web|url=https://matplotlib.org/index.html|title=Matplotlib: Python plotting — Matplotlib 3.2.0 documentation|website=matplotlib.org|access-date=2020-03-14}}</ref> Matplotlib is designed to be as usable as MATLAB, with the ability to use Python, and the advantage of being free and [[Open source|open-source]].
 
==Plot Types==
[[Matplotlib]] supports various types of 2 dimensional and 3 dimensional plots. The support for two dimensional plots is robust including: line plots, histogram, scatter plots, polar plots, box plots, pie charts, bar graphs, and heat maps. The support for three dimensional plots was added later and while it is good, it is not as robust as 2 dimensional plots. You can have 3 dimensional line plots, scatter plots, and surface plots. You can determine what plot type you need by considering a few factors:<br/>'''Comparing a relationship between different variables:''' line plot, heat map, contour plot, scatter plot<br/>'''Looking for distribution of your dataset:''' box plot, histogram <br/>'''Comparing different categories:''' box plot, pie chart, bar graph
 
===Examples===
<gallery mode="packed">
File:Synchrotron Functions.svg|'''Line plot (2D or 3D)'''<br/>Displays data in line format showing trends over time
File:Matplotlib histogram v.svg|'''Histogram'''<br/>Used to display the frequency of subsets in a dataset
File:Sparse data.png|'''Scatter plot (2D or 3D)'''<br/>Displays each component of the dataset as a single plotted point; shows relationships between points
File:Matplotlib 3d v.svg|'''3D surface plot'''<br/>Represents the dataset in the X, Y, and Z plane
File:Mpl example Helmoltz coils.svg|'''Contour plot'''<br/>Graphs data connecting points of equal values giving a 3D effect
File:Logarithmic Spiral Pylab.svg|'''Polar plot'''<br/>Visualizing data in a circular plane
File:Mandelbrot set, plotted with Matplotlib.svg|'''Image plot'''<br/>Visualizes 2D arrays as an image
File:BOXPLOT.png|'''Box Plot'''<br/>Used to show the distribution of a data set. The median and outliers are highlighted
File:PIECHART.png|'''Pie Chart'''<br/>Useful for showing the proportions of each category involved
File:BARGRAPH.png|'''Bar Graph'''<br/>Useful for comparing different groups side by side
File:HEATMAP.png|'''Heat map'''<br/>Displays 2D array of dataset in a colored image to visualize the frequency or density in a specific area
</gallery>
 
==Animations==