One solution would be to use the plt.legend function, even if you don't need the actual legend. You can specify the location of the legend window using the loc keyterm key. More information can be found on this website , but I also gave an example showing how to place the legend:
ax.scatter(xa,ya, marker='o', s=20, c="lightgreen", alpha=0.9) ax.scatter(xb,yb, marker='o', s=20, c="dodgerblue", alpha=0.9) ax.scatter(xc,yc marker='o', s=20, c="firebrick", alpha=1.0) ax.scatter(xd,xd,xd, marker='o', s=20, c="goldenrod", alpha=0.9) line1 = Line2D(range(10), range(10), marker='o', color="goldenrod") line2 = Line2D(range(10), range(10), marker='o',color="firebrick") line3 = Line2D(range(10), range(10), marker='o',color="lightgreen") line4 = Line2D(range(10), range(10), marker='o',color="dodgerblue") plt.legend((line1,line2,line3, line4),('line1','line2', 'line3', 'line4'),numpoints=1, loc=2)
Note that since loc=2 , the legend is in the upper left corner of the graph. And if the text overlaps with the graph, you can reduce it using legend.fontsize , which then reduces the conventions.