0

To use a graph I want to save a plot at the highest quality. When I use plt.savefig(), the image is blank. I've the code and output (now a screenshot) below. I want to use it in my thesis so the quality needs to be high.

Code:

df = data[[ 'acq_cc', 'tar_cc']]
c = [ 'acq_cc', 'tar_cc']

df[c].value_counts().head(20).plot(kind='barh', title = 'Top-20 most occuring country combinations',
                                   ylabel = 'Number of acquisitions',
                                   xlabel = 'Acquiror, Target country-code',
                                   color = ['0.05', '0.1', '0.15', '0.2', '0.25', '0.3', '0.35', '0.4', '0.45',
                                  '0.5', '0.55', '0.6', '0.65', '0.7', '0.75', '0.8', '0.85', '0.9', '0.95'],
                                  fontsize = 7.5). 

plt.savefig('acq-tar_cc.png', format = 'svg', dpi=1000)

Output:

enter image description here

0 Answers0