Wolfram Language Fast Introduction for Math Students
Get Started »

Plots in 2D

Generate a 2D plot of a polynomial function:

(The interval notation of {x,min,max} defines the domain.)
In[1]:=
Click for copyable input
Plot[x^2 + 2 x + 1, {x, -10, 10}]
Out[1]=

Or plot a 2D region for a set of inequalities:

(&& is the symbol for And.)
In[2]:=
Click for copyable input
RegionPlot[Reduce[{x^2 + y < 2 && x + y < 1}], {x, -3, 3}, {y, -3, 3}]
Out[2]=

There are lots of useful options to customize visualizations, like adding legends:

In[1]:=
Click for copyable input
Plot[{x^3, x^2, x}, {x, -2, 2}, PlotLegends -> "Expressions"]
Out[1]=

Or filling a plot to visualize the area under a curve:

In[2]:=
Click for copyable input
Plot[1/x, {x, -3, 3}, Filling -> Axis]
Out[2]=

Combine different plot types with Show:

In[1]:=
Click for copyable input
Show[{Plot[x^2 + 2, {x, -3, 3}], 
  RegionPlot[2 x > y - 3, {x, -3, 3}, {y, 0, 9}]}]
Out[1]=

QUICK REFERENCE: Function Visualization »

QUICK REFERENCE: Graphics Options & Styling »