I have some data in the form of data[time] = list of y values
.
(data example: data = [[1, 2, 3], [1, 2], [5, 6, 7, 8]]
)
I want to plot that data using matplotlib in a way that every y
value will be a dot (square) in the position (time, y)
.
Currently I'm using matplotlib.pyplot.scatter
to do so
( plt.scatter(x = [time]*len(data[time]), y = data[time], s=5, marker='s')
), but the problem is that every square's height is too short, while the width is fine.
Is there a way to control the square's height separately and not both width and height with s
? (scatter is not required, every plotting way is acceptable)
Example plot:
You can see there are vertical spaces between the squares, while there aren't any horizontal spaces.