PYTHON // PLOTTING WITH PYPLOT
.
Write the code in Python to create a bar chart where x-axis plots the values of an array P where values in P are ([1,2,3,4]) and y-axis plots the values both for P*2 (in red) and P**2 (in blue).
.
Plz help needed
Answers
Answered by
1
Answer:
Following steps were followed:
Define the x-axis and corresponding y-axis values as lists.
Plot them on canvas using . plot() function.
Give a name to x-axis and y-axis using . xlabel() and . ylabel() functions.
Give a title to your plot using . title() function.
Finally, to view your plot, we use . show() function.
Similar questions