Python scatter plot. Size and style of the marker

Translate from user data coordinate system to display coordinate system.

and use edgecolors=”none” to plot faces with no outlines.

import numpy as np

fig = figure()
ax = fig.add_subplot(111)
dx_in_points = np.diff(ax.transData.transform(zip([0]*len(dx), dx))) 
scatter(x,y,c=z,s=dx_in_points**2,marker="s", edgecolors="none")

Leave a Comment