CYBER WEEK - EXTRA SAVINGS EVENT
TRY A FREE LESSON

How to Center Plots in Jupyter Notebook

I’ve spent hours googling “how to center plots in Jupyter Notebook” and have tried adding many different code lines as per instructions (Stack Overflow, … etc.) but with no success.

Can anyone show me what coding would work? Thank you kindly.
Regards,
Bruce

Depends on the Jupyter version, quick google search led me to stackoverflow
On that page, I’ve found this to be the best solution for me:

from IPython.core.display import HTML
HTML("""
<style>
.output_png {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
}
</style>
""")