I cannot get my y-axis label to display what I would like to do. What am I doing wrong?
I've tried playing around with the dollar sign placement but no luck so far.
I want to achieve the following, but without the word "nac" and some slight changes:
However, I get the following y-axis on my plot:
plt.figure(2)
x = [4.6, 5.6, 6.3, 7]
y = [0.05037, 0.04814, 0.04853, 0.05013]
y2 = [0.05037, 0.04931, 0.05039, 0.05224]
y3 = [0.07234, 0.05952, 0.05645,0.0538]
plt.plot(x,y, 'bo--', label='A', markersize=8, linewidth=1)
plt.plot(x,y2, 'ro--', label='B', markersize=8, linewidth=1)
plt.plot(x,y3, 'go--', label='C', markersize=8, linewidth=1)
axes = plt.gca()
axes.set_xlim([4.6,7])
plt.xlabel('length/diameter', fontsize=15)
plt.ylabel(r'$\Delta CD_{Mach} ($M_{\infty}$ = 0.85 \longrightarrow$
0.87$)', fontsize=15)
plt.legend(loc='best')
#plt.show()
plt.savefig('test.png', dpi = 300)
plt.close()
plt.ylabel(r'$\Delta C_{D_{nac}}^{Mach} (M_{\infty} = 0.85 \longrightarrow 0.87$)')