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=(14,10)) rect1 = ax.bar(x_playstation, playstation,width, label = 'Playstation',color = COLOR) # CHECK HERE # set the color of y-axis ax.yaxis.label.set_color(COLOR) ax.tick_params(axis='y', colors=COLOR, labelsize=10) ax.tick_params(axis='x', rotation=20, labelsize=10) ax.set_title('The hardware market', fontsize=13) ax.set_ylabel('Total sales (in millions)', fontsize=13) # set y-axis on the right side ax2 = ax.twinx() ax2.plot(phases,pc_sales,label = 'PC Sales',color = 'red',marker = 'o') # CHECK HERE # this line shows the text numbers along the markers in the line for i, j in zip(phases, pc_sales): ax2.annotate(str(round(j,2)), xy=(i, j)) # 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)', fontsize=13) plt.xticks(rotation=45) ax.legend() autolabel(rect1) plt.show()

How to change the unit of y-axis on the left side? (100000000, 200000000,, 300000000,....)

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!