Skip to content

How to change the thickness of the marker "x" when using scatter? #17192

Closed
@sth1997

Description

@sth1997

I'm trying to change the thickness of the marker "x" when using scatter, but I found the "linewidths" parameter doesn't work for Matplotlib version 3.1.0.
But when I switch to Matplotlib version 1.3.1, "linewidths" parameter works well. Why? Is there something changed in newer version?
This is my code.

import matplotlib.pyplot as plt
import numpy as np
import matplotlib
print(matplotlib.__version__)
x = y = np.arange(5)

fig,ax = plt.subplots(1)

ax.scatter(x,y,  s=100,marker='x',color='b',linewidths=1)
ax.scatter(x,y+1,s=100,marker='x',color='r',linewidths=2)
ax.scatter(x,y+2,s=100,marker='x',color='g',linewidths=3)

plt.show()

This is the figure output by Matplotlib 3.1.0.
figure_1

This is the figure output by Matplotlib 1.3.1.
figure_2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions