简体   繁体   中英

Boxplot: how to not show the plot?

A very basic question:

I create a boxplot from a dictionary and just want to assign the result to a variable; for example:

import matplotlib.pyplot as plt
df = {'A': [34.54, 34.345, 34.761], 'B': [34.541, 34.748, 34.482]}
bp = plt.boxplot(df.values())

I didn't use instruction plt.show() , nevertheless the plot is shown by defaut, although I don't want it. Is there a special way to instruct the program not show the plot?

To not show the plot, use the plt.close() function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM