Question: import matplotlib.pyplot as plt plt.style.use('ggplot') plt.rcParams[figure.figsize] = (129, 119) # set the color here COLOR = 'blue' def autolabel(rectangle_group): for rect in rectangle_group: height =

import matplotlib.pyplot as plt plt.style.use('ggplot') plt.rcParams["figure.figsize"] = (129, 119) # set the color here COLOR = 'blue' def autolabel(rectangle_group): for rect in rectangle_group: height = rect.get_height() ax.annotate(str(height), xy = (rect.get_x() + rect.get_width() / 2,height), ha = 'center', xytext = (0,3),textcoords = 'offset points', color = 'grey') phases = ['ABCDDDEE', 'FFEEBCDDDEE', 'CEBCDDDAAAAAAA', 'CDDDAAAAAAA', 'MDDAAAAAA', 'EEEEEEEQQDDGEEFEGEP', 'TEEEEQQDDGEEF', 'EEEQQDDGEEFV', 'SAEFEHWHEHEEEE'] playstation = [128025310, 116520050, 241038900, 26338370, 241298260, 734332223, 626385333, 535270300, 99187000 ] pc_sales = [0.499088743030168, 0.240923281868178, 0.0660538759431783, 0.0493960725965669, 0.406346654626102, 0.0400699034093881, 0.385682463666874, 0.0992130526364415, 0.32786310400448837 ] width = 0.2 x_playstation = [x - width for x in range(len(playstation))] x_xbox = [x for x in range(len(playstation))] x_nintendo = [x + width for x in range(len(playstation))] fig,ax = plt.subplots(figsize=(7,5)) rect1 = ax.bar(x_playstation, playstation,width, label = 'Playstation',color = COLOR) # set the color of y-axis ax.yaxis.label.set_color(COLOR) ax.tick_params(axis='y', colors=COLOR) ax.tick_params(axis='x', rotation=20, labelsize=7) ax.set_title('The hardware market') ax.set_ylabel('Total sales (in millions)') # set y-axis on the right side ax2 = ax.twinx() ax2.plot(phases,pc_sales,label = 'PC Sales',color = 'red',marker = 'o') # set y-range ax2.set_ylim((0,1)) ax2.yaxis.label.set_color('red') ax2.tick_params(axis='y', colors='red') # set y label ax2.set_ylabel('Total sales (in millions)') plt.xticks(rotation=45) ax.legend() autolabel(rect1) plt.show()

How to put the number above each point of the line graph? (like the bar chart)

and How to make the font bigger? (especially for the font in the x-axis)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!