I am stuck with a (hopefully) simple problem. My aim is to plot a dashed line interrupted with data (not only text).
As I only found out to create a dashed line via linestyle = 'dashed', any help is appreciated to put the data between the dashes.
Something similar, regarding the labeling, is already existing with Matplotlib - as I saw in the contour line demo.
Update:
The question link mentioned by Richard in comments was very helpful, but not the 100% like I mentioned via comment. Currently, I do it this way:
line_string2 = '-10 ' + u"\u00b0" +"C"
l, = ax1.plot(T_m10_X_Values,T_m10_Y_Values)
pos = [(T_m10_X_Values[-2]+T_m10_X_Values[-1])/2., (T_m10_Y_Values[-2]+T_m10_Y_Values[-1])/2.]
# transform data points to screen space
xscreen = ax1.transData.transform(zip(T_m10_Y_Values[-2::],T_m10_Y_Values[-2::]))
rot = np.rad2deg(np.arctan2(*np.abs(np.gradient(xscreen)[0][0][::-1])))
ltex = plt.text(pos[0], pos[1], line_string2, size=9, rotation=rot, color='b',ha="center", va="bottom",bbox = dict(ec='1',fc='1', alpha=0.5))
Here you can see a snapshot of the result. The minus 20°C is without BBox.