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:
When plotting data with ListPlot, Mathematica automatically chooses how to display the points:
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:
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:
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:
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:
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:
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:
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:
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:
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:
You can also choose different point sizes, including Tiny, Small, Medium, or Large: