Home > Enterprise >  Increase the length of hline marker in matplotlib
Increase the length of hline marker in matplotlib

Time:02-05

I want to plot data using a constant, not too small, horizontal line for each value.

It seems the way to do it is with

x = np.arange(0, 10, 2)
y = [2,3,4,1,7]
plt.scatter(x, y, marker="_")
plt.legend(loc='Height')
plt.show()

but the horizontal lines are too small. Can they be customized to some greater length, at least a length similar to thewidth of a bar plot? Thx.

CodePudding user response:

Do you mean that you want to increase marker size?

plt.scatter(x, y, marker="_", s=400)

s=400

s=1000

s=1000

  •  Tags:  
  • Related