Tutorial by Examples

Pandas uses provides multiple ways to make graphs of the data inside the data frame. It uses matplotlib for that purpose. The basic graphs have their wrappers for both DataFrame and Series objects: Line Plot df = pd.DataFrame({'x': [10, 8, 10, 7, 7, 10, 9, 9], 'y': [6, 4, 5, 5...
plot() can take arguments that get passed on to matplotlib to style the plot in different ways. df.plot(style='o') # plot as dots, not lines df.plot(style='g--') # plot as green dashed line df.plot(style='o', markeredgecolor='white') # plot as dots with white edge
By default, plot() creates a new figure each time it is called. It is possible to plot on an existing axis by passing the ax parameter. plt.figure() # create a new figure ax = plt.subplot(121) # create the left-side subplot df1.plot(ax=ax) # plot df1 on that subplot ax = plt.subplot(122) # c...

Page 1 of 1