You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When plotting data with either 'scatter' or 'plot', the markers are slightly offset when the 'facecolor' or 'edgecolor' are set to 'none'.
It seems to happen only with some markers: ". o v ^ 8 p P * h H X x". I could not verify for '1 2 3 4'. Some markers are always offset (different issue maybe): '+ | _'
Code for reproduction
importmatplotlib.pyplotaspltfig=plt.figure(figsize=(12, 12))
ax=plt.axes()
#Markerm='8'#Error when 'none' is chosen as 'facecolor'ax.scatter(1,1,marker=m,edgecolor='red',facecolor='none') #Marker offsetax.scatter(1,2,marker=m,edgecolor='red',facecolor='black') #No marker offset#Error when 'none' is chosen as 'edgecolor'ax.scatter(2,1,marker=m,edgecolor='none', facecolor='red') #Maker offsetax.scatter(2,2,marker=m,edgecolor='black',facecolor='red') #No marker offset#Grid, to see the offsetax.grid()
You can also see the misalignement when plotting to point on top of each other (therefore the problem does not come from adding the grid). This is most apparent when the top one is smaller:
importmatplotlib.pyplotaspltfig=plt.figure(figsize=(12, 12))
ax=plt.axes()
#Markerm='8'#Same size markers#It looks like an eclipseax.scatter(0,0,marker=m,edgecolor='red', facecolor='red')
ax.scatter(0,0,marker=m,edgecolor='none',facecolor='black')
#Different size markersax.scatter(0.5,0.5,s=50,marker=m,edgecolor='red', facecolor='red')
ax.scatter(0.5,0.5,s=30,marker=m,edgecolor='none',facecolor='black')
Expected outcome
The markers should be aligned with the grid or on top of each other.
Matplotlib version
Operating system: Win 10
Matplotlib version: 3.0.1(but also present in 2.1)
Matplotlib backend: Qt5Agg
Python version: 3.6.3
The text was updated successfully, but these errors were encountered:
This is a known issue, and I'm going to close as covered elsewhere.
Markers are placed to the nearest pixel, supposedly for speed. If you need sub-pixel accuracy, use PDF or more pixels. You could also try out the third-party library that will hopefully make it into matplotlib one of these days: https://github.com/anntzer/mplcairo
Bug report
When plotting data with either 'scatter' or 'plot', the markers are slightly offset when the 'facecolor' or 'edgecolor' are set to 'none'.
It seems to happen only with some markers: ". o v ^ 8 p P * h H X x". I could not verify for '1 2 3 4'. Some markers are always offset (different issue maybe): '+ | _'
Code for reproduction
You can also see the misalignement when plotting to point on top of each other (therefore the problem does not come from adding the grid). This is most apparent when the top one is smaller:
Expected outcome
The markers should be aligned with the grid or on top of each other.
Matplotlib version
The text was updated successfully, but these errors were encountered: