Main.Legends History

Hide minor edits - Show changes to markup

May 04, 2010, at 02:53 PM MST by 10.84.44.105 -
Added lines 1-36:

(:source lang=python:)

""" A plot with a legend """

x1 = [0, 10, 20, 40, 70] x2 = [0, 5, 10, 20, 40] x3 = [0, 5, 10, 15, 20]

y1 = [5, 4, 3, 1.2, 0.2] y2 = [5, 3.8, 2.5, 1.0, -0.3] y3 = [5, 3.3, 1.5, 0, -0.3]

import matplotlib.pyplot as plt

ax = plt.subplot(1,1,1) ax.plot(x1, y1, 'ko', label = '50 rpm', markersize=8) ax.plot(x1, y1, 'k-') ax.plot(x2, y2, 'k^', label = '100 rpm', markersize=8) ax.plot(x2, y2, 'k-') ax.plot(x3, y3, 'ks', label = '125 rpm', markersize=8) ax.plot(x3, y3, 'k-')

handles, labels = ax.get_legend_handles_labels() ax.legend(handles, labels, shadow=True, numpoints = 1)

plt.xlim(xmax = 75) plt.xlim(xmin = -1) plt.ylim(ymax = 5.3) plt.xlabel(r'Light Fluence (J/cm$^2$)') plt.ylabel('VSV titer (log 10)')

plt.show()

(:sourceend:)