Reputation: 1521
I've a scatter plot
import matplotlib.pyplot as plt
import numpy as np
x = [(1,0), (0, 1), (2, 1), (3, 1)]
y = [1, 4, 8.5, 17.5]
plt.scatter([str(i) for i in x], y, linestyle='dashed', marker='s')
plt.show()
I tried to use the linestyle
key to connect the points by a dashed line. Unfortunately, this didn't work.
Any suggestions on how to do this?
EDIT: I'm using scatter plot for the reason mentioned here
Upvotes: 0
Views: 12130
Reputation: 1521
import matplotlib.pyplot as plt
import numpy as np
x = [(1,0), (0, 1), (2, 1), (3, 1)]
y = [1, 4, 8.5, 17.5]
plt.plot([str(i) for i in x], y, linestyle='dashed', marker='s')
plt.show()
Upvotes: 4