Pandas notes

From DiLab
Revision as of 15:29, 25 October 2017 by Leo (talk | contribs) (Plot options)
Jump to: navigation, search

Using Python Pandas package for data analysis. Leo's notes.

Plot options

Define the colors of the plot data

df.plot(color="rgbk")

Different plot types (markers)

df.plot(marker='.')

Limit the X axis values:

df.plot(xlim=(0,4000))

Naming the axis

ax = df.plot()
ax.set_ylabel(AntNames[x])

Placement of the legend (Below-left of the plot)

df.plot().legend(loc='upper left', bbox_to_anchor=(0, 0))

Removing the legend

ax = df.plot()
ax.legend_.remove()