How to | Display and Style Data Points on a 2D Curve

When plotting curves from data, there are several methods you can use to display the data points along the curve. While the default settings for displaying such plots are suitable in most cases, the Wolfram Language also includes options that allow you to style the curves and data points as you wish.

ListLinePlot and ListPlot can create 2D curves from lists of data.

First, define some data to plot:

In[1]:=
Click for copyable input

ListPlot is most commonly used to create scatter plots from lists of data. By default, ListPlot does not join the data points with a line:

In[2]:=
Click for copyable input
Out[2]=

ListLinePlot is used to plot a line between a list of values. By default, the Wolfram Language does not draw points on curves created by ListLinePlot:

In[3]:=
Click for copyable input
Out[3]=

You can display the data points along the curves with the PlotMarkers or Mesh options:

In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=

Use the PlotStyle option with Mesh to change the color of each curve:

In[6]:=
Click for copyable input
Out[6]=

Use the PlotStyle option with PlotMarkers to change the color of each curve and its points. Note that the result of PlotStyle here is different from when PlotStyle was used with Mesh:

In[7]:=
Click for copyable input
Out[7]=

Similar to PlotStyle, the MeshStyle option lets you use graphics directives to style the points in a plot. You must also use Mesh to be able to use MeshStyle:

In[8]:=
Click for copyable input
Out[8]=

You cannot use Mesh or MeshStyle to change the type of points in a plot. You must use PlotMarkers to do this:

In[9]:=
Click for copyable input
Out[9]=

You can use Mesh and PlotMarkers together, but points created by PlotMarkers take precedence over those created by Mesh:

In[10]:=
Click for copyable input
Out[10]=

As long as Mesh is used, you can still style the points with MeshStyle:

In[11]:=
Click for copyable input
Out[11]=

The styling techniques shown here will also work on curves drawn by ListPlot.

    

The Wolfram Language can also display points in 3D plots. For example, you may wish to view the underlying data points of this 3D surface generated by ListPlot3D:

In[1]:=
Click for copyable input
Out[1]=

Use ListPointPlot3D to do this:

In[2]:=
Click for copyable input
Out[2]=