0

I'm trying to save my plot on jupyter. It works but when I open the png file, it's empty.

Here are my imports:

    import pandas as pd
    import matplotlib.pyplot as plt
    import seaborn as sns
    import numpy as np

And here is my code:

    sns.barplot(x='unique_values',
        y="counts", 
        data=df2,
        color='blue')

    plt.xlabel("Cylinders", size=11)
    plt.ylabel("Value counts", size=11)
    plt.title("Count of each cylinder value", size=14)
    plt.show()
    plt.savefig('barplot2.png')

Thank you for your help!

rakh
  • 53
  • 4
  • 2
    Try to put `plt.savefig()` before than `plt.show()` . Here there is a related [question](https://stackoverflow.com/questions/32244753/how-to-save-a-seaborn-plot-into-a-file). – StandardIO Oct 21 '22 at 22:15

0 Answers0