setup_charting_and_output#
API documentation for tradeexecutor.utils.notebook.setup_charting_and_output Python function.
- setup_charting_and_output(mode=OutputMode.interactive, image_format='svg', max_rows=1000, width=1500, height=1500)[source]#
Sets charting and other output options for Jupyter Notebooks.
Interactive charts are better for local development, but are not compatible with most web-based notebook viewers.
Set Quantstats chart to SVG output and for high-resolution screens
Mute common warnings like Matplotlib font loading
Example how to set up default interactive output settings. Add early of your notebook do:
# Set Jupyter Notebook output mode parameters. # For example, table max output rows is lifted from 20 to unlimited. from tradeexecutor.utils.notebook import setup_charting_and_output setup_charting_and_output()
Example how to set up static image rendering:
# Set charts to static image output, 1500 x 1000 pixels from tradeexecutor.utils.notebook import setup_charting_and_output, OutputMode setup_charting_and_output(OutputMode.static, image_format=”png”, width=1500, height=1000)
- Parameters:
mode (OutputMode) – What kind of viewing context we have for this notebook output
image_format –
Do we do SVG or PNG.
SVG is better, but Github inline viewer cannot display it in the notebooks.
max_rows –
Do we remove the
max_rows
limitation from Pandas tables.Default 20 is too low to display summary tables.