nltk_book icon indicating copy to clipboard operation
nltk_book copied to clipboard

Chapter 4 - Section 4.8 A Sample of Python Libraries - SubSection Matplotlib

Open SamuelCabralCruz opened this issue 7 years ago • 0 comments

In the source code showing how to use Agg backend, you should put in evidence that the chart must be processed between the use of Agg and the saving of the figure.

import matplotlib
matplotlib.use('Agg')
bar_chart(genres, modals, counts)
pylab.savefig('modals.png')  
print('Content-Type: text/html') 
print() 
print('<html><body>') 
print('<img src="modals.png"/>') 
print('</body></html>')

SamuelCabralCruz avatar Jul 31 '17 13:07 SamuelCabralCruz