Skip to content Skip to sidebar Skip to footer

Using PyLab To Create A 2D Graph From Two Separate Lists

This seems like a basic problem with an easy answer but I simply cannot figure it out no matter how much I try. I am trying to create a line graph based on two lists. For my x-axi

Solution 1:

from pylab import *
from matplotlib.font_manager import FontProperties

dates = ["Jan-06","Jul-06","Jan-07","Jul-07","Jan-08"]
x_axis_list = range(len(dates))
y_axis_list = [5,7,6,8,9]

figure()
plot(x_axis_list, y_axis_list, "k")
xticks(x_axis_list, dates, rotation=45)
show()

Post a Comment for "Using PyLab To Create A 2D Graph From Two Separate Lists"