|
I implemented %bar %pie %line %df and %lsmagic.
All the charting magic commands are using under the hood the corresponding function from within pandas.DataFrame.plot.
Each charting magic has the ability to receive as arguments any option that would be valid in the corresponding function from DataFrame.plot and additionally any other option valid in DataFrame.plot or matplotlib's pyplot.plot. It just forwards the space-separated shell-like list of arguments to the right plot function of DataFrame.plot (e.g. %line x='col1' y='col2' subplots=True translates somewhere down the line into DataFrame.plot.line(x='col1', y='col2', subplots=True) )
The only exception to this mapping is in the %pie magic command. %pie accepts an optional index='column_name' which basically specifies the 'x' axis of the pie chart (the names of the slices). In Python it is possible to alter the index of a DataFrame with .set_index() before calling .plot.pie(), I thought it is a good idea to provide our users to do the same with this magic command.
|