Skip to main content

Section 1.2 Using Software for Plotting

Subsection 1.2.1 Plotting Lines

Software can help with the plotting of lines, planes and linear inequalities. In SubsectionΒ 1.1.1, the equation \(3x+4y=12\) and linearly inequality \(3x+4y \leq 12\) was plotted.
Visit Desmos which will look like:
(for accessibility)
Figure 1.2.1.
Enter 3x+4y=12 in the first box (outlined in blue) and you should see
(for accessibility)
Figure 1.2.2.
Additional lines can be plotted by adding them to the box below the previous line. For example, enter y=2x=3 results in
(for accessibility)
Figure 1.2.3.

Subsection 1.2.2 Plotting Inequalities and Feasible Sets

Inequalities can also be plotted. Return to desmos and remove all equations by hitting the X on the right side of each entry box. Now add 3x+4y ≀ 12 where Demos will automatically convert <= to ≀. The resulting plot will be
(for accessibility)
Figure 1.2.4.
Note that the colors of all the plots may be different. Desmos usually cycles through the colors in a specific manner, but this may differ as you enter equations.
The graph shows both the line as solid and the color as a light green indicating that the region below and left of the line is part of the inequality.
This idea can be extended to plotting sets of inequalities to arrive at a feasible set. Recall that in SectionΒ 1.1 the set of inequalities:
\begin{align*} 3x+4y \amp \leq 12 \\ y \amp \geq x+1 \end{align*}
was plotted. If we add the second inequality to Demos we get
(for accessibility)
Figure 1.2.5.
With only two inequalities, visually the overlap (the set of points that satisfy both inequalities) is reasonably easy to see, however, as these grow, it can be more difficulty to see. One way is to plot the opposite inequality and then area of the plane with no coloring would be the resultant set.

Example 1.2.6.

Use Desmos to plot the region that satisfies the following:
\begin{equation*} \begin{aligned} x - 2y \leq -2, \\ 5x-2y \geq 15, \\ 3x+5y \geq 75. \end{aligned} \end{equation*}
Solution.
We open up Desmos and add all three of the inequalities, except switching each inequality. The result is
(for accessibility)
Figure 1.2.7.
The set of points that satisfy the three inequalities is the triangular region without any shading.

Subsection 1.2.3 Graphing Planes

As we saw in SectionΒ 1.1, planes are another example of linear functions that we will encounter in this text. Desmos also has a 3D graphing calculator. Open up the webpage and it will look like the regular graphing calculator, however the default axes are in \(\mathbb{R}^3\text{.}\)
Add x+2y+3z=12 to the plot and you should get a plane. Spin the axes around and zoom in and out with the + and - buttons. You may get something that looks like
(for accessibility)
Figure 1.2.8.
Inequalities can also be plotted, however, they are difficult to read. For example, change the \(=\) in the previous plane to a \(\leq\) or \(\geq\) and you will see that half of the \(\mathbb{R}^3\) space is now colored red (in my case). However, adding another inequality will be quite difficult to see the intersecting region.