Medical Data Visualizer - No file saved

Hi - Below is code.

plt.show() is showing a graph. But file is not saving in replit. Any ideas thanks?!

 gcat = sns.catplot(data = df_cat, x = 'variable', hue = 'value', col = 'cardio', kind = 'count')
    gcat.set_axis_labels('variable', 'total')
    
    plt.show()
    fig = gcat.fig

    # Do not modify the next two lines
    fig.savefig('catplot.png')
    return fig```

I’ve noticed my code does not get to the print ‘‘here’’…

plt.show()
    print("here")
    fig = gcat.fig```

While plt.show() displays the plot it blocks further execution.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.