Computer Science, asked by harshitajai143, 9 months ago

(E). The axes of a plot can be labelled using ................. and ................... functions.​

Answers

Answered by prasadvinit1102
4

Use matplotlib. pyplot. plot() to draw a line between two points

point1 = [1, 2]

point2 = [3, 4]

x_values = [point1[0], point2[0]] gather x-values.

y_values = [point1[1], point2[1]] gather y-values.

plt. plot(x_values, y_values)

Answered by ravilaccs
0

Answer:

The axes of a plot can be labeled using  X and Y functions.​

Explanation:

  • After installing Matplotlib, we will begin coding by importing Matplotlib using the command: import matplotlib. pyplot as pit Now you have imported Matplotlib in your workspace. You need to display the plots.
  • Using Matplotlib from within a Python script, you have to add the
  • plt.show( ) method inside the file to display your plot. With plt. xlabel and plt. label, you can assign labels to that respective axis.
  • Next, you can assign the plot’s title with plot. title, and then invoke the default legend with
  • plot legend( ).
  • plt.plot (years, total_populations)
  • plt.title → (“Year vs Population in India”)
  • plt.xlabel → (“Year”)
  • plt.ylabel (“Total Population”)
  • plt.legend( )
  • plt.show( )
  • Plt.title( ) → specifies title to the graph  
  • Plt.xlabel( ) → specifies label for X-axis
  • Plt.label( ) → specifies label for Y-axis
Similar questions