1. Background
In some Python data visualization functions required during plt Videos histogram and line graph.
2. Import
import matplotlib.pyplot as plt
3. Histogram
array= np.array(array) plt.hist(array, bins=50,facecolor="red", edgecolor="red" ,linewidth=5,alpha=0.7) plt.xlabel("") plt.ylabel("") plt.title("")
4. FIG polyline
plt.figure (figsize = (num_group,. 6)) X-= [1,2,3,4,5,6,7,8,9] the Y = [1,2,3,4,5,6,7, 8,9] # line graph defines X, Y coordinates plt.plot (X, Y, label = str (model_name)) # line chart for a, B in ZIP (X, Y): plt.text (a, B , '% .2f'% b, ha = 'center', va = 'bottom', fontsize = 7) # values for each point plt.legend (loc = 2) # display each polyline label plt.title ( "{}". format (eval_key )) # name showing
5. Save
print("=> saving {}".format(image_name)) plt.savefig(image_name)