Key Ideas
1Why Visualize Math. A well-made graph can reveal trends, outliers, and relationships far faster than scanning a table of numbers.
2Line Plots. Show how a value changes continuously, ideal for functions like y=sin(x) or a dataset changing over time.
3Scatter Plots. Show individual data points without connecting them, ideal for spotting correlation or clusters between two variables.
4Bar Charts and Histograms. Bar charts compare categories; histograms show the distribution of a single numeric variable by grouping values into bins.
5Common Plotting Tools. Python's matplotlib is the most widely used plotting library; plt.plot() draws line plots, plt.scatter() draws scatter plots, and plt.hist() draws histograms.
Worked Examples
You want to plot y=x^2 for x from -5 to 5. What type of plot is most appropriate?
A line plot (using plt.plot())
You have exam scores for 100 students and want to see the distribution. What type of plot is best?
A histogram (using plt.hist())
You want to check if there's a relationship between study hours and exam scores for 50 students. What plot type is best?
A scatter plot (using plt.scatter())