Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
NumberLinePlot
  • See Also
    • ListPlot
    • RegionPlot
    • Graphics
    • DateListPlot
    • Interval
    • FunctionDomain
    • FunctionRange
    • TimelinePlot
    • RadialAxisPlot
    • ParallelAxisPlot
  • Related Guides
    • Data Visualization
    • Function Visualization
    • Tabular Visualization
    • See Also
      • ListPlot
      • RegionPlot
      • Graphics
      • DateListPlot
      • Interval
      • FunctionDomain
      • FunctionRange
      • TimelinePlot
      • RadialAxisPlot
      • ParallelAxisPlot
    • Related Guides
      • Data Visualization
      • Function Visualization
      • Tabular Visualization

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
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Data  
Tabular Data  
Presentation  
Options  
AspectRatio  
Axes  
AxesLabel  
Show More Show More
AxesStyle  
ImageSize  
PlotLegends  
PlotRange  
PlotStyle  
PlotTheme  
Spacings  
Ticks  
TicksStyle  
Applications  
Properties & Relations  
See Also
Related Guides
Related Links
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • ListPlot
    • RegionPlot
    • Graphics
    • DateListPlot
    • Interval
    • FunctionDomain
    • FunctionRange
    • TimelinePlot
    • RadialAxisPlot
    • ParallelAxisPlot
  • Related Guides
    • Data Visualization
    • Function Visualization
    • Tabular Visualization
    • See Also
      • ListPlot
      • RegionPlot
      • Graphics
      • DateListPlot
      • Interval
      • FunctionDomain
      • FunctionRange
      • TimelinePlot
      • RadialAxisPlot
      • ParallelAxisPlot
    • Related Guides
      • Data Visualization
      • Function Visualization
      • Tabular Visualization

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

  • The vi can be numbers, Interval objects, Around objects or lists of these.
  • The predicate pred can be any logical combination of inequalities.
  • The speci can be numbers, intervals, or symbolic predicates.
  • NumberLinePlot[Tabular[…]cspec] extracts and plots values from the tabular object using the column specification cspec.
  • The following forms of column specifications cspec are allowed for plotting tabular data:
  • colplot values from column col
    {col1,col2,…,coln}plot columns {col1, …, coln} as groups of values
  • NumberLinePlot has the same options as Graphics, with the following additions: [List of all options]
  • AspectRatio Automaticratio of height to width
    IntervalMarkersAutomatichow to render uncertainty
    IntervalMarkersStyleAutomaticstyle for uncertainty elements
    PlotLegends Nonelegends for the sets
    PlotStyle Automaticgraphics directives to specify styles
    PlotTheme $PlotThemeoverall theme for the plot
    Spacings Automaticwhether to plot different sets in the list pred at different heights
  • ColorData["DefaultPlotColors"] gives the default sequence of colors used by PlotStyle.
  • The default setting of Spacings->Automatic evenly spaces each speci above the axis.
  • Spacings->{s1,s2,…} places spec1 distance s1 from the axis, spec2 distance s2 from spec1, etc.
  • Spacings->n is equivalent to Spacings->{n,n,…}
  • Spacings->None places all of the speci at the same height above the axis.
  • With the default setting of AspectRatio->Automatic, the ratio is chosen based on the layout of the speci.
  • List of all options

    • AlignmentPointCenterthe default point in the graphic to align with
      AspectRatioAutomaticratio of height to width
      AxesFalsewhether to draw axes
      AxesLabelNoneaxes labels
      AxesOriginAutomaticwhere axes should cross
      AxesStyle{}style specifications for the axes
      BackgroundNonebackground color for the plot
      BaselinePositionAutomatichow to align with a surrounding text baseline
      BaseStyle{}base style specifications for the graphic
      ContentSelectableAutomaticwhether to allow contents to be selected
      CoordinatesToolOptionsAutomaticdetailed behavior of the coordinates tool
      Epilog{}primitives rendered after the main plot
      FormatTypeTraditionalFormthe default format type for text
      FrameFalsewhether to put a frame around the plot
      FrameLabelNoneframe labels
      FrameStyle{}style specifications for the frame
      FrameTicksAutomaticframe ticks
      FrameTicksStyle{}style specifications for frame ticks
      GridLinesNonegrid lines to draw
      GridLinesStyle{}style specifications for grid lines
      ImageMargins0.the margins to leave around the graphic
      ImagePaddingAllwhat extra padding to allow for labels etc.
      ImageSizeAutomaticthe absolute size at which to render the graphic
      IntervalMarkersAutomatichow to render uncertainty
      IntervalMarkersStyleAutomaticstyle for uncertainty elements
      LabelStyle{}style specifications for labels
      MethodAutomaticdetails of graphics methods to use
      PlotLabelNonean overall label for the plot
      PlotLegendsNonelegends for the sets
      PlotRangeAllrange of values to include
      PlotRangeClippingFalsewhether to clip at the plot range
      PlotRangePaddingAutomatichow much to pad the range of values
      PlotRegionAutomaticthe final display region to be filled
      PlotStyleAutomaticgraphics directives to specify styles
      PlotTheme$PlotThemeoverall theme for the plot
      PreserveImageOptionsAutomaticwhether to preserve image options when displaying new versions of the same graphic
      Prolog{}primitives rendered before the main plot
      RotateLabelTruewhether to rotate y labels on the frame
      SpacingsAutomaticwhether to plot different sets in the list pred at different heights
      TicksAutomaticaxes ticks
      TicksStyle{}style specifications for axes ticks

Examples

open all close all

Basic Examples  (5)

Show the first 10 prime numbers on a number line:

Wolfram Language code: NumberLinePlot[Prime[Range[10]]]

Display an interval:

Wolfram Language code: NumberLinePlot[Interval[{0, 1}]]

Show where an inequality is true:

Wolfram Language code: NumberLinePlot[Sin[x] < Cos[x], {x, 0, 2Pi}]

Show an infinite interval:

Wolfram Language code: NumberLinePlot[Interval[{0, ∞}]]

Show several sets on a single number line:

Wolfram Language code: NumberLinePlot[{Range[20], 2Range[10], 3Range[6], 5Range[4], 7 Range[2]}]

Scope  (9)

Data  (7)

Show multiple sets:

Wolfram Language code: NumberLinePlot[{{Interval[{0, 1}]}, Interval[{0, 2}]}]

Use Interval and single points:

Wolfram Language code: NumberLinePlot[{Interval[{0, 1}], 2, Interval[{0, 2}]}]

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

Wolfram Language code: NumberLinePlot[{{Interval[{0, 1}], 2}, Interval[{0, 2}]}]

Use an inequality:

Wolfram Language code: NumberLinePlot[0 < x ≤ 1, x]

Use a logical conjunction of equalities and inequalities:

Wolfram Language code: NumberLinePlot[-2 ≤ x < 1 || x == 2 || x > 3, x]

Use a list to represent more than one set:

Wolfram Language code: NumberLinePlot[{-2 ≤ x < 1 || x > 3, x == 2}, x]

Use a more complicated inequality:

Wolfram Language code: NumberLinePlot[x ^ 3 < Sin[13x], x]

Tabular Data  (1)

Get tabular data:

Wolfram Language code: tabular = ResourceData["Sample Tabular Data: Fisher Iris"]

Plot petal length in a number line:

Wolfram Language code: NumberLinePlot[tabular -> "PetalLength"]

Plot elements of both petal and sepal Length as separate number lines:

Wolfram Language code: NumberLinePlot[tabular -> {"PetalLength", "SepalLength"}]

Include a legend for the plot:

Wolfram Language code: NumberLinePlot[tabular -> {"PetalLength", "SepalLength"}, PlotLegends -> {"petal", "sepal"}]

Create columns of petal length per species:

Wolfram Language code: pivot = PivotToColumns[tabular, "Species" -> "PetalLength"]

Plot petal lengths grouped by species:

Wolfram Language code: NumberLinePlot[pivot -> {"setosa", "versicolor", "virginica"}, PlotLegends -> {"setosa", "versicolor", "virginica"}]

Presentation  (1)

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

Wolfram Language code: NumberLinePlot[{x > 0, x == 0, x < 0}, x, PlotTheme -> "Marketing"]

Use a theme with detailed information:

Wolfram Language code: NumberLinePlot[{x > 0, x == 0, x < 0}, x, PlotTheme -> "Detailed"]

Options  (43)

AspectRatio  (4)

By default, the ratio of the height to width for the plot is determined automatically:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}]

Make the height the same as the width with AspectRatio1:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AspectRatio -> 1]

Use numerical value to specify the height-to-width ratio:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AspectRatio -> 1 / 2]

AspectRatioFull adjusts the height and width to tightly fit inside other constructs:

Wolfram Language code: plot = NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AspectRatio -> Full];
Wolfram Language code: {Framed[Pane[plot, {50, 100}]], Framed[Pane[plot, {100, 100}]], Framed[Pane[plot, {100, 50}]]}

Axes  (2)

By default, axes are drawn:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}]

Use AxesFalse to turn off axes:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, Axes -> False]

AxesLabel  (2)

No axes labels are drawn by default:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}]

Place a label on the axis:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AxesLabel -> x]

AxesStyle  (4)

Change the style for the axes:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AxesStyle -> Red]

Specify the style of each axis:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AxesStyle -> Directive[Thick, Red]]

Use different styles for the ticks and the axes:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AxesStyle -> Green, TicksStyle -> StandardGray]

Use different styles for the labels and the axes:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AxesStyle -> Green, LabelStyle -> StandardGray]

ImageSize  (7)

Use named sizes such as Tiny, Small, Medium and Large:

Wolfram Language code: {NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, ImageSize -> Tiny], NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, ImageSize -> Small]}

Specify the width of the plot:

Wolfram Language code: {NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, ImageSize -> 150], NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AspectRatio -> 1.5, ImageSize -> 150]}

Specify the height of the plot:

Wolfram Language code: {NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, ImageSize -> {Automatic, 50}], NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AspectRatio -> 2, ImageSize -> {Automatic, 50}]}

Allow the width and height to be up to a certain size:

Wolfram Language code: {NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, ImageSize -> UpTo[200]], NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AspectRatio -> 2, ImageSize -> UpTo[200]]}

Specify the width and height for a graphic, padding with space if necessary:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, ImageSize -> {200, 200}, Background -> StandardBrown]

Setting AspectRatioFull will fill the available space:

Wolfram Language code: NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AspectRatio -> Full, ImageSize -> {200, 200}, Background -> StandardBrown]

Use maximum sizes for the width and height:

Wolfram Language code: {NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, ImageSize -> {UpTo[150], UpTo[100]}], NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AspectRatio -> 2, ImageSize -> {UpTo[150], UpTo[100]}]}

Use ImageSizeFull to fill the available space in an object:

Wolfram Language code: Framed[Pane[NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, ImageSize -> Full, Background -> StandardBrown], {200, 100}]]

Specify the image size as a fraction of the available space:

Wolfram Language code: Framed[Pane[NumberLinePlot[{x^2 > 1, Tan[x] ≠ 0, Sin[x] > 0}, {x, -7, 7}, AspectRatio -> Full, ImageSize -> {Scaled[0.5], Scaled[0.5]}, Background -> StandardBrown], {200, 100}]]

PlotLegends  (7)

By default, no legends are used:

Wolfram Language code: NumberLinePlot[{x < 0, x > 0}, x]

Create a legend based on the expressions:

Wolfram Language code: NumberLinePlot[{x < 0, x > 0}, x, PlotLegends -> "Expressions"]

Create a legend with placeholder text:

Wolfram Language code: NumberLinePlot[{x < 0, x > 0}, x, PlotLegends -> Automatic]

Create a legend with specific labels:

Wolfram Language code: NumberLinePlot[{x < 0, x > 0}, x, PlotLegends -> {"one", "two"}]

PlotLegends picks up PlotStyle values automatically:

Wolfram Language code: NumberLinePlot[{x < 1, x > 1}, x, PlotStyle -> {{Red, Dashed}, Blue}, PlotLegends -> Automatic]

Use Placed to position legends:

Wolfram Language code: NumberLinePlot[{x < 1, x > 1}, x, PlotLegends -> Placed[Automatic, Below]]

Use LineLegend to modify the appearance of the legend:

Wolfram Language code: NumberLinePlot[{x < 1, x > 1}, x, PlotLegends -> LineLegend["Expressions", LegendFunction -> "Frame"]]

PlotRange  (2)

PlotRange is automatically calculated:

Wolfram Language code: NumberLinePlot[Range@10]

Set explicit plot range:

Wolfram Language code: NumberLinePlot[Range@10, PlotRange -> {{4, 6}, All}]

PlotStyle  (3)

By default, different styles are chosen for multiple curves:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x]

Explicitly specify the style for different curves:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, PlotStyle -> {Red, Blue, Green}]

Specify styles for the endpoints:

Wolfram Language code: NumberLinePlot[{x == 0 || 1 < x ≤ 2, 0 ≤ x < 1 || x == 2}, x, PlotStyle -> {Directive[Thick, Red, PointSize[Large]], Directive[Dashed, Blue, PointSize[Medium]]}, AspectRatio -> 1 / 4]

PlotTheme  (1)

Use a theme with simple ticks and bright colors:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, PlotTheme -> "Business"]

Add another theme with legends:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, PlotTheme -> {"Detailed", "Business"}]

Change the colors:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, PlotTheme -> {"Detailed", "Business"}, PlotStyle -> {RGBColor[0.468742, 0., 0.0158236], RGBColor[0.7514516, 0.09778, 0.0063294399999999995], RGBColor[0.9108294, 0.2745386, 0.020955220000000004], RGBColor[0.9819778, 0.4844202000000001, 0.05144122000000002], RGBColor[1., 0.6815686, 0.08952772000000002], RGBColor[1., 0.820127, 0.126955]}]

Spacings  (4)

By default, sets are evenly spaced above the axis:

Wolfram Language code: NumberLinePlot[{x ^ 2 > 1, x ^ 2 > 3}, {x, -4, 4}]

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

Wolfram Language code: NumberLinePlot[{x ^ 2 > 1, x ^ 2 > 3}, {x, -4, 4}, Spacings -> None]

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

Wolfram Language code: NumberLinePlot[{x ^ 2 > 1, x ^ 2 > 3}, {x, -4, 4}, Spacings -> 0]

Place the second set close to the first set:

Wolfram Language code: NumberLinePlot[{x ^ 2 > 1, x ^ 2 > 3}, {x, -4, 4}, Spacings -> {1, 0.5}]

Ticks  (4)

Ticks are placed automatically in each plot:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x]

Use TicksNone to not draw any tick marks:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, Ticks -> None]

Place tick marks at specific positions:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, Ticks -> {{-2, 0, 2}, Automatic}]

Draw tick marks at the specified positions with the specified labels:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, Ticks -> {{{-2, -a}, {0, b}, {2, a}}, Automatic}]

TicksStyle  (3)

Specify overall ticks style, including the tick labels:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, TicksStyle -> Directive[Red, 12]]

Specify tick marks with scaled lengths:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, Ticks -> {{{-2, -a, .1}, {0, b, .05}, {2, a, .25}}, Automatic}]

Customize each tick with position, length, labeling and styling:

Wolfram Language code: NumberLinePlot[Table[x ^ 2 > k, {k, 0, 5}], x, Ticks -> {{{-2, -a, .15, Directive[Thick, Darker@Green]}, {0, b, .05, Directive[Blue]}, {2, a, .25, Directive[Dashed, Thick, Purple]}}, Automatic}]

Applications  (6)

Illustrate the domain of a function:

Wolfram Language code: FunctionDomain[Sqrt[1 - x ^ 2], x]
Wolfram Language code: NumberLinePlot[%, x]

Illustrate the Range of a function:

Wolfram Language code: FunctionRange[(E^x/x), x, y]
Wolfram Language code: NumberLinePlot[%, {y, -5, 5}]

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

Wolfram Language code: ϕ[n_] := Cos[Pi n]ArcTan[n](2 / Pi + Sin[n] / n)
Wolfram Language code: NumberLinePlot[{Table[ϕ[n], {n, 1, 300}]}, PlotStyle -> Directive[StandardGreen, PointSize[Small], Opacity[.2]]]

Show where a function is increasing or decreasing:

Wolfram Language code: f[x_] := 2x ^ 3 + 3x ^ 2 - 12x + 5
Wolfram Language code: Show[{Plot[f[x], {x, -3, 3}, PlotStyle -> StandardGray], NumberLinePlot[{Derivative[1][f][x] > 0, Derivative[1][f][x] < 0, Derivative[1][f][x] == 0}, {x, -3, 3}, PlotStyle -> {Red, Blue, StandardGray}, Spacings -> 0, PlotLegends -> {"Increasing", "Decreasing", "Stationary"}]}]

Visualize the construction of the Cantor set:

Wolfram Language code: NumberLinePlot[NestList[# /. {a_, b_} :> Sequence[{a, 0.6 a + 0.4 b}, {0.4 a + 0.6 b, b}]&, Interval[{0, 1}], 5], {x, 0, 1}, AspectRatio -> 1, PlotStyle -> PointSize[0], PlotRangePadding -> Scaled[0.1]]

Illustrate the not-so-trivial history of Albert Einstein's citizenship:

Wolfram Language code: data = {{Interval[{1879, 1896}], "Kingdom of Württemberg - German Empire"}, {Interval[{1896, 1901}], "Stateless"}, {Interval[{1901, 1955}], "Switzerland"}, {Interval[{1911, 1912}], "Austria - Austro-Hungarian Empire"}, {Interval[{1914, 1918}], "Kingdom of Prussia - German Empire"}, {Interval[{1918, 1933}], "Free State of Prussia - Weimar Republic"}, {Interval[{1940, 1955}], "United States"}};
Wolfram Language code: NumberLinePlot[data[[All, 1]], PlotLegends -> data[[All, -1]], AspectRatio -> .7]

Properties & Relations  (3)

Use RegionPlot and RegionPlot3D for showing higher-dimensional regions:

Wolfram Language code: {NumberLinePlot[Norm[{x}] ≤ 1, {x, -2, 2}], RegionPlot[Norm[{x, y}] ≤ 1, {x, -2, 2}, {y, -2, 2}], RegionPlot3D[Norm[{x, y, z}] ≤ 1, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]}

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

Wolfram Language code: {NumberLinePlot[Prime[Range[10]]], ListPlot[Prime[Range[10]]], ListLinePlot[Prime[Range[10]]]}

Use RadialAxisPlot and ParallelAxisPlot to display multidimensional points:

Wolfram Language code: {NumberLinePlot[{1, 2, 5, 3, 7}], RadialAxisPlot[{1, 2, 5, 3, 7}], ParallelAxisPlot[{1, 2, 5, 3, 7}]}

See Also

ListPlot  RegionPlot  Graphics  DateListPlot  Interval  FunctionDomain  FunctionRange  TimelinePlot  RadialAxisPlot  ParallelAxisPlot

Function Repository: TapeDiagram

Related Guides

    ▪
  • Data Visualization
  • ▪
  • Function Visualization
  • ▪
  • Tabular Visualization

Related Links

  • An Elementary Introduction to the Wolfram Language : Displaying Lists

History

Introduced in 2014 (10.0) | Updated in 2019 (12.0) ▪ 2025 (14.2)

Wolfram Research (2014), NumberLinePlot, Wolfram Language function, https://reference.wolfram.com/language/ref/NumberLinePlot.html (updated 2025).

Text

Wolfram Research (2014), NumberLinePlot, Wolfram Language function, https://reference.wolfram.com/language/ref/NumberLinePlot.html (updated 2025).

CMS

Wolfram Language. 2014. "NumberLinePlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/NumberLinePlot.html.

APA

Wolfram Language. (2014). NumberLinePlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NumberLinePlot.html

BibTeX

@misc{reference.wolfram_2026_numberlineplot, author="Wolfram Research", title="{NumberLinePlot}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/NumberLinePlot.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_numberlineplot, organization={Wolfram Research}, title={NumberLinePlot}, year={2025}, url={https://reference.wolfram.com/language/ref/NumberLinePlot.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English