df >> Plot() >> plot_points('x', 'y') >> show()Plot(df) >> plot_points('x', 'y') >> add_color('category') >> show()df.filter(...).sort_values(...) >> Plot() >> plot_points('x', 'y') >> show()Plot(df).plot_points('x', 'y').add_color('category').show()# WRONG - pandas doesn't support this
df >> (lambda d: d[d['x'] > 0]) >> Plot() # TypeError!Why: Pandas DataFrames don't natively support the >> operator with functions.
# CORRECT
filtered_df = df[df['x'] > 0].sort_values('y')
plot = filtered_df >> Plot() >> plot_points('x', 'y') >> show()
# Or in one chain:
plot = (df[df['x'] > 0]
.sort_values('y')
>> Plot()
>> plot_points('x', 'y')
>> show())pip install pipeframefrom pipeframe import DataFrame as pf_df
plot = (pf_df(df)
>> (lambda d: d[d._df['x'] > 0]) # Now lambdas work!
>> (lambda d: d.sort_values('y'))
>> Plot()
>> plot_points('x', 'y')
>> show())# Traditional approach
filtered = df[df['x'] > 0]
plot = Plot(filtered).plot_points('x', 'y').show()from pipeplotly import Plot
from pipeplotly.verbs import (
plot_points, plot_lines, plot_bars,
add_color, add_size, add_labels,
set_theme, show, save
)- For simple viz: Use method chaining (
.) - For data + viz: Use pandas methods then pipe to Plot
- For complex pipelines: Use pipeframe package
- Restart kernel: After code changes to pipeplotly source
df >> Plot() >> plot_points('x', 'y') >> show()df >> Plot() >> plot_points('x', 'y') >> add_color('cat', palette='viridis') >> set_theme('dark') >> show()df[df['x'] > 10].sort_values('y') >> Plot() >> plot_lines('x', 'y') >> show()df >> Plot() >> plot_points('x', 'y') >> to_interactive() >> show()