How to | Change the Type and Color of Points in a 2D Scatter Plot

While the default settings for plots created in the Wolfram Language are sufficient in most cases, nearly every aspect of plots is customizable. In addition to letting you change the size of points in a 2D plot, the Wolfram Language also lets you change the color and type of marker for points.

The Wolfram Language lets you change the type of marker that is used as a point in a plot by using the PlotMarkers option.

First, define some data to plot:

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

Use ListPlot and PlotMarkers to plot the data with an asterisk for data points:

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

The Wolfram Language contains many special characters and symbols that can also be used as points in a plot. You can access these from the Special Characters palette (located in the Palettes menu), or by using the keyboard alias for the character you want to use. To view the keyboard alias for a character, mouse over it in the palette.

You can also create your own plot markers from scratch:

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

Use the graphic you just created as a plot marker with a size of :

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

To change the color of points in a plot, use the PlotStyle option. Here, the color Red is specified:

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

Any of the colors supported by the Wolfram Language can be used to color points in a plot.

In this example, RGBColor is used with Manipulate to allow dynamic setting of the color. Move the sliders to set different values for , , and :

    

Adding additional datasets to your plots and styling them requires little additional work.

First, define some datasets that you will plot:

In[1]:=
Click for copyable input

Plot the data using ListPlot:

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

Use PlotMarkers to specify the point type and size for each dataset. The position of the point type and size specification in the list to the right of PlotMarkers corresponds to the dataset of the same position in the list that is the first argument to ListPlot.

In the plot here, specifies the point type and size for the dataset , and so on. The markers come from the Special Characters palette:

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

Change the colors from the default scheme by using PlotStyle with similar syntax:

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

The Wolfram Language also lets you change the color of points in 3D plots, such as those generated by ListPointPlot3D.

For example, you can use PlotStyle to set the color of points generated by ListPointPlot3D:

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

You can also use color gradients with 3D plots. One way to use ColorFunction is to implement a predefined color gradient in the direction:

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