How to | Change the Size of Points in a 2D Scatter Plot

Customization is an important part of Mathematica's extensive data visualization capabilities. While the default settings for displaying points in a plot are suitable in most cases, you have full control over the size of the points in the plot.

First, define some data to plot:

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

When plotting data with ListPlot, Mathematica automatically chooses how to display the points:

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

By using the PlotMarkers option, you can gain much more control over the appearance of the points in a plot. The setting Automatic gives a predefined standard sequence of markers for successive lists of points.

The points here are larger than those in the first example:

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

Setting point sizes with PlotMarkers will cause the points to be absolute in size. In other words, the size of the points will not change if you resize the plot.

To change the size of points used by PlotMarkers, you can use the predefined symbolic values Tiny, Small, Medium, or Large:

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

To see how each size setting looks, click the sizes in this Manipulate:

You can also set the size of points in PlotMarkers by using numerical values.

Here, the point size is set to a value of 3:

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

To see how the different sizes look, use the slider in this Manipulate to adjust the point size from 1 to 30:

You can also change the size of points in a plot by using the graphics directives PointSize or AbsolutePointSize with the PlotStyle option.

Here, PointSize is used with PlotStyle to set the size of points in the plot. The number used with PointSize represents the diameter of each point relative to the total width of the plot:

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

AbsolutePointSize lets you specify the size of points by using an absolute point diameter. The units are measured in printer's points, equal before magnification to 1/72 of an inch:

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

PointSize and AbsolutePointSize also accept the predefined symbolic values Tiny, Small, Medium, and Large. When these predefined symbolic values are used, regardless of whether they are used with PointSize or AbsolutePointSize, the points generated are absolute in size.

    

You can extend the techniques shown above to multiple sets of data on a single plot.

First, define multiple sets of data to plot:

In[9]:=
Click for copyable input

Change the size of the points, with equal point sizes across datasets:

Give the points of each dataset different sizes. The points for , , and have sizes 5, 10, and 15, respectively:

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

Instead of using Automatic markers, the markers in this last plot were set explicitly. For more information on specifying the markers used in plots, see How to: Change the Type and Color of Points in a 2D Scatter Plot.

You can also use PlotStyle and PointSize to give the points of each dataset different sizes. The points for have a relative PointSize of 0.02, the points for have a relative PointSize of 0.04, and the points for have a relative PointSize of 0.06:

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

Mathematica also lets you change the size of points in 3D visualizations, such as those generated by ListPointPlot3D.

The default point size works well in most cases:

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

You can also choose different point sizes, including Tiny, Small, Medium, or Large:

New to Mathematica? Find your learning path »
Have a question? Ask support »