English

Observe the following figure. Identify the coding for obtaining this as output.

Advertisements
Advertisements

Question

Observe the following figure. Identify the coding for obtaining this as output.

Options

  • import matplotlib.pyplot as plt
    Months = ['Dec', 'Jan', 'Feb', 'Mar']
    Attendance = [70, 90, 75, 95]
    plt.bar(Months, Attendance)
    plt.show()

  • import matplotlib.pyplot as plt
    Months = ['Dec', 'Jan', 'Feb', ' Mar']
    Attendance = [70, 90, 75, 95]
    plt.bar(Attendance, Months)
    plt.show()

  • import matplotlib.pyplot as plt
    Months = ['Dec', 'Jan', 'Feb', 'Mar']
    Attendance = [70, 90, 75, 95]
    plt.bargraph (Months, Attendance)
    plt.show()

  • import matplotlib.pyplot as plt
    Months = ['Dec', 'Jan', 'Feb', 'Mar']
    Attendance = [70, 90, 75, 95]
    plt.barplot (Months, Attendance)
    plt.show()

MCQ
Advertisements

Solution

import matplotlib.pyplot as plt
Months = ['Dec', 'Jan', 'Feb', 'Mar']
Attendance = [70, 90, 75, 95]
plt.bar(Months, Attendance)
plt.show()

shaalaa.com
Plotting Using Matplotlib
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×