Repository navigation
Description
Bug report
Bug summary
Markers in line plots and scatter plots cannot be created without antialiasing. The argument antialiased=False is ignored. The scatter dots are still antialiased when calling
plt.scatter(..., antialiased=False)
plt.plot(..., marker="o", antialiased=False)
The line of a line plot as well as a Circle are however obeying to turning the antialiasing off.
Code for reproduction
I will provide a not-so-minimal example here, but which allows to directly observe the difference between antialiased=True and antialiased=False within matplotlib and can potentially directly be used as a test for the issue.
The following produces a two-part image, each with a line, a circle (red, nose) and a scatter and a line plot with marker (orange, eyes). In the left part all artists are being given the antialiased=True, in the right part antialiased=False.
import io
import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
fig, axes = plt.subplots(ncols=2, figsize=(.5,.25), dpi=72)
fig.subplots_adjust(0,0,1,1,0,0)
## Produce a line plot, a scatter and a circle
## Set antialiased=True, False to observe the difference.
for aa,ax in zip([True,False],axes):
ax.axis([0,3,0,3])
ax.axis("off")
ax.plot([.8,1.2,1.8,2.2],[1,.6,.6,1], antialiased=aa)
ax.scatter([2],[2],s=16,edgecolor="k",facecolor="C1", antialiased=aa)
ax.plot([1],[2],marker="o",ms=4,mec="k",mfc="C1", antialiased=aa)
c = plt.Circle((1.5,1.5), radius=0.35, edgecolor="k",
facecolor="C3", antialiased=aa)
ax.add_patch(c)
buf = io.BytesIO()
fig.savefig(buf)
#fig.savefig("test"+str(matplotlib.get_backend())+".png")
plt.close()
## Read and show the produced images from above as imshow
fig, (ax,ax2) = plt.subplots(ncols=2, figsize=(5,2.6))
buf.seek(0)
im = plt.imread(buf)
ax.imshow(im[:,:im.shape[1]//2], origin="upper")
ax2.imshow(im[:,im.shape[1]//2:], origin="upper")
ax.set_title("antialiased=True")
ax2.set_title("antialiased=False")
fig.suptitle(matplotlib.get_backend())
fig.savefig("antialiased"+str(matplotlib.get_backend())+".png")
plt.show()
Actual outcome
Expected outcome
In the right image, we would expect the orange dots to consist only of black and orange pixels, similar to the red circle (the nose).
Matplotlib version
- Operating system: Windows 8.1
- Matplotlib version: 2.2
- Matplotlib backend: TkAgg, same with Qt4Agg
- Python version: 2.7.10

Activity
timhoffm commentedon Mar 18, 2018
Not a backend expert, but it looks like
RendererAgg::draw_markersdoes not checkGCAgg.isaaand always uses the antiliased renderer.jklymak commentedon Mar 27, 2018
Closing due to #10833
QuLogic commentedon Mar 27, 2018
Did you check that it's fixed? That PR is not necessarily supposed to fix it.
jklymak commentedon Mar 27, 2018
Sorry! 🐑
github-actions commentedon May 2, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!