Pass marker to each Axes.scatter() call when plots need different shapes. To give plots a shared default, set Matplotlib’s scatter.marker rcParam; use rc_context when that default should apply only temporarily.
Give each scatter plot its own marker
Set marker on each axes’ scatter() call. For example, this creates two side-by-side plots with a circle and an upward triangle:
As an Amazon Associate I earn from qualifying purchases.
import matplotlib.pyplot as plt
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.scatter(x1, y1, marker="o", s=36, label="Group A")
ax2.scatter(x2, y2, marker="^", s=36, label="Group B")
Here x1, y1, x2, and y2 stand for your data arrays. The marker argument accepts a text shorthand or a MarkerStyle instance, as described in the Axes.scatter API. Common shorthands include o for circle, s for square, ^ for upward triangle, D for diamond, and * for star. See the marker reference examples for more options.
Set a shared default for multiple plots
If scatter calls should use the same marker unless a call specifies otherwise, set scatter.marker. Matplotlib lists it as the default scatter marker in its configuration reference.
#1 Best Overall
Limit the default to a block of code
Use mpl.rc_context to apply a temporary setting. Once the block ends, the prior runtime configuration is restored.
import matplotlib as mpl
import matplotlib.pyplot as plt
with mpl.rc_context({"scatter.marker": "s"}):
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.scatter(x1, y1)
ax2.scatter(x2, y2)
Both scatter calls use squares here because neither supplies its own marker. A per-call marker is the right choice when one plot should differ from the shared default. Matplotlib also supports style sheets and matplotlibrc for reusable configuration; its documented precedence is runtime rc settings, then style sheets, then matplotlibrc. See the customization guide.
Rank #2
Size scatter markers with the right parameter
Use s in scatter() to set marker size. Its values are approximately proportional to visual area, so they are not directly interchangeable with markersize in plot(), which is generally specified as marker width or diameter in points. Copying the same number between the two functions will not necessarily produce markers with the same visible dimensions. Matplotlib explains the distinction in its quick start guide.
Recommended Free Tools
s can be a scalar for a uniform size or array-like when points need different sizes. For scatter examples combining size and color, see Matplotlib’s scatter plot example.
Choose shape alongside other visual encodings
Marker shape is one way to distinguish groups, but scatter plots also support face color, edge color, transparency, size, and color mapping. Use shapes and colors consistently, and label groups when that makes the plot easier to interpret. The scatter API documents these styling arguments.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




