Python Foundation

+91-7982108418            


MATPLOTLIB BASIC

  1. Write a Python program to draw a line with suitable label in the x axis, y axis and a title. The code snippet gives the output shown in the following screenshot:
  • 2) Write a Python program to draw a line using given axis values with suitable label in the x axis , y axis and a title. The code snippet gives the output shown in the following screenshot:
  • 3) Write a Python program to draw a line using given axis values taken from a text file, with suitable label in the x axis, y axis and a title. Test Data: test.txt 1 2 2 4 3 1 The code snippet gives the output shown in the following screenshot:
  • 4) Write a Python program to draw line charts of the financial data of Alphabet Inc. between October 3, 2016 to October 7, 2016. Sample Financial data (fdata.csv): Date,Open,High,Low,Close 10-03-16,774.25,776.065002,769.5,772.559998 10-04-16,776.030029,778.710022,772.890015,776.429993 10-05-16,779.309998,782.070007,775.650024,776.469971 10-06-16,779,780.47998,775.539978,776.859985 10-07-16,779.659973,779.659973,770.75,775.080017 The code snippet gives the output shown in the following screenshot:
  • 5) Write a Python program to plot two or more lines on same plot with suitable legends of each line. The code snippet gives the output shown in the following screenshot:
  • 6)Write a Python program to plot two or more lines with legends, different widths and colors. The code snippet gives the output shown in the following screenshot:
  • 7) Write a Python program to plot two or more lines with different styles. The code snippet gives the output shown in the following screenshot:
  • 8) Write a Python program to plot two or more lines and set the line markers. The code snippet gives the output shown in the following screenshot:
  • 9) Write a Python program to display the current axis limits values and set new axis values. The code snippet gives the output shown in the following screenshot:
  • 10) Write a Python program to plot quantities which have an x and y position. The code snippet gives the output shown in the following screenshot:
  • 11) Write a Python program to plot several lines with different format styles in one command using arrays. The code snippet gives the output shown in the following screenshot:
  • 12) Write a Python program to create multiple types of charts (a simple curve and plot some quantities) on a single set of axes. The code snippet gives the output shown in the following screenshot:
  • 13) Write a Python program to display the grid and draw line charts of the closing value of Alphabet Inc. between October 3, 2016 to October 7, 2016. Customized the grid lines with linestyle -, width .5. and color blue. Date,Close 03-10-16,772.559998 04-10-16,776.429993 05-10-16,776.469971 06-10-16,776.859985 07-10-16,775.080017 The code snippet gives the output shown in the following screenshot:
  • 14) Write a Python program to display the grid and draw line charts of the closing value of Alphabet Inc. between October 3, 2016 to October 7, 2016. Customized the grid lines with rendering with a larger grid (major grid) and a smaller grid (minor grid).Turn on the grid but turn off ticks. The code snippet gives the output shown in the following screenshot:
  • 15) Write a Python program to create multiple plots. The code snippet gives the output shown in the following screenshot:

Powered by BetterDocs

Contact Us
close slider