NumberLinePlot

NumberLinePlot[{v1,v2,}]

plots the values vi on a number line.

NumberLinePlot[pred,x]

plots a number line illustrating the region pred.

NumberLinePlot[pred,{x,xmin,xmax}]

plots the number to extend over the interval from xmin to xmax.

NumberLinePlot[{spec1,spec2,},]

plots several number lines.

Details and Options

Examples

open allclose all

Basic Examples  (5)

Show the first 10 prime numbers on a number line:

Display an interval:

Show where an inequality is true:

Show an infinite interval:

Show several sets on a single number line:

Scope  (8)

Data  (7)

Show multiple sets:

Use Interval and single points:

Group intervals and points into a single list to represent a single set:

Use an inequality:

Use a logical conjunction of equalities and inequalities:

Use a list to represent more than one set:

Use a more complicated inequality:

Presentation  (1)

Use a theme with dark background and high-contrast colors:

Use a theme with detailed information:

Options  (15)

PlotLegends  (7)

By default, no legends are used:

Create a legend based on the expressions:

Create a legend with placeholder text:

Create a legend with specific labels:

PlotLegends picks up PlotStyle values automatically:

Use Placed to position legends:

Use LineLegend to modify the appearance of the legend:

PlotStyle  (3)

By default, different styles are chosen for multiple curves:

Explicitly specify the style for different curves:

Specify styles for the endpoints:

PlotTheme  (1)

Use a theme with simple ticks and bright colors:

Add another theme with legends:

Change the colors:

Spacings  (4)

By default, sets are evenly spaced above the axis:

Use Spacings->None to place the sets on top of one another:

Use Spacings->0 to place all the sets on the axis:

Place the second set close to the first set:

Applications  (5)

Illustrate the domain of a function:

Illustrate the Range of a function:

Visualize the accumulation points of a sequence on the real line:

Show where a function is increasing or decreasing:

Visualize the construction of the Cantor set:

Properties & Relations  (2)

Use RegionPlot and RegionPlot3D for showing higher-dimensional regions:

Use ListPlot and ListLinePlot to show numbers as a list of heights:

Introduced in 2014
 (10.0)
 |
Updated in 2019
 (12.0)