how to plot a graph using matplotlib
from matplotlib import pyplot as plt
plt.plot([0, 1, 2, 3, 4, 5], [0, 1, 4, 9, 16, 25])
plt.show()
how to plot a graph using matplotlib
from matplotlib import pyplot as plt
plt.plot([0, 1, 2, 3, 4, 5], [0, 1, 4, 9, 16, 25])
plt.show()
how to import matplotlib.pyplo in python
import matplotlib.pylot as plt
matplotlib graph
matplotlib Graph
-------------------------------
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
height = [10, 20, 30, 40, 50]
tick_label = ['one', 'two', 'three', 'four', 'five']
plt.bar(x, height, tick_label = tick_label,
width = 0.5, color = ['red', 'green'])
plt.xlabel('x axis')
plt.ylabel('y axis')
plt.title('matplotlib Graph')
plt.show()
show graph matplotlib axes
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("filesc/file1.csv")
df.head()
BBox = ((df.x.min(), df.x.max(), df.y.min(), df.y.max()))
ruh_m = plt.imread('map.png')
print(BBox)
fig, ax = plt.subplots(figsize = (8,7))
ax.scatter(df.x, df.y, zorder=1, alpha= 0.2, c='b', s=10)
ax.set_title('Plotting Spatial Data on Map')
ax.set_xlim(BBox[0],BBox[1])
ax.set_ylim(BBox[2],BBox[3])
ax.imshow(ruh_m, zorder=0, extent = BBox, aspect= 'equal')
plt.show()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us