Open junxnone opened 4 years ago
plt.grid()
plt.grid(linestyle='-.') plt.grid(ls='--')
plt.grid(c='r')
plt.grid(axis="x") plt.grid(axis="y")
import cv2 import matplotlib.pyplot as plt %matplotlib inline img_path = 'xxxx' bgr_img = cv2.imread(img_path) img = cv2.cvtColor(bgr_img, cv2.COLOR_BGR2RGB) fig = plt.figure(figsize=(20,20)) ax = fig.add_subplot(111) ax.xaxis.set_ticks(range(0, img.shape[1], 100)) ax.yaxis.set_ticks(range(0, img.shape[0], 100)) plt.grid(alpha=0.3) plt.imshow(img)
Reference
Brief
Example