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
The saved figures of a scatter plot are rendered/interpreted completely different from showing them. This is consistent and might be related to #18871 and/or #8847. Is there a way to circumvent this and to get closer to the desired plot from 'show()' whilst saving to a file?
Code for reproduction
importmatplotlib.pyplotasplt# for my tests version 3.3.2importnumpyasnp# Creating datasetnp.random.seed(42)
x=np.random.random_sample(size=10000)
y=np.random.random_sample(size=10000)
z=np.random.random_sample(size=10000)
# Creating figurefig=plt.figure(figsize=(16, 9))
ax=plt.axes(projection="3d")
# Add x, y gridlinesax.grid(b=True, color='grey', linestyle='-.', linewidth=0.3, alpha=0.2)
# Creating color map# https://matplotlib.org/3.1.0/tutorials/colors/colormaps.htmlmy_cmap=plt.get_cmap('brg')
# Creating plotsctt=ax.scatter3D(x, y, z, alpha=0.8, c=z, cmap=my_cmap, marker='o')
plt.title("3D-Scatter")
ax.set_xlabel('x label', fontweight='bold')
ax.set_ylabel('y label', fontweight='bold')
ax.set_zlabel('z label', fontweight='bold')
fig.colorbar(sctt, ax=ax, shrink=0.5, aspect=5)
# show plotplt.show()
# plt.savefig('fig_savefig.png')plt.close()
Actual outcome
Expected outcome
Matplotlib version
Operating system: Win10
Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.3.2
Bug report
Bug summary
The saved figures of a scatter plot are rendered/interpreted completely different from showing them. This is consistent and might be related to #18871 and/or #8847. Is there a way to circumvent this and to get closer to the desired plot from 'show()' whilst saving to a file?
Code for reproduction
Actual outcome

Expected outcome

Matplotlib version
import matplotlib; print(matplotlib.__version__)
): 3.3.2print(matplotlib.get_backend())
): TkAggThe text was updated successfully, but these errors were encountered: