Answers for "matplotlib linear plot"

0

how to plot a linear equation in matplotlib

import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-5,5,100)
y = 2*x+1
plt.plot(x, y, '-r', label='y=2x+1')
plt.title('Graph of y=2x+1')
plt.xlabel('x', color='#1C2833')
plt.ylabel('y', color='#1C2833')
plt.legend(loc='upper left')
plt.grid()
plt.show()
Posted by: Guest on December-30-2020
3

python plot

import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4], [1, 4, 9, 16])
plt.show()
Posted by: Guest on December-09-2020
0

how do a plot on matplotlib python

import matplotlib.pyplot as plt
%matplotlib inline
plt.plot(data)
#this is not nessisary but makes your plot more readable
plt.ylabel('y axis means ...')
plt.xlabel('x axis means ...')
Posted by: Guest on June-29-2020

Python Answers by Framework

Browse Popular Code Answers by Language