Lets say I have the following data say
x=[0,1,2,3,4,5,6,7,8,9]
y=[1.0,1.5,2.3,2.2,1.1,1.4,2.0,2.8,1.9,2.0]
z=['A','A','A','B','B','A','B','B','B','B']
plt.plot(x,y, marker='S')
will give me a x-y plot with square markers. Is there a way to change the marker type based on the data z, so that all 'A' type has square marker and 'B' type has a triangle marker.
but I want to add 'z' data on the curve only when it changes from one type to another (in this case from 'A' to 'B' or vice versa)