some ticks in Matplotlib

million_yh / 2023-08-18 / 原文

  • It's import matplotlib.pyplot as plt  ranther than import matplotlib as plt.
  • We often codeplt.subplot(121),plt.imshow(img),plt.title('Input'),plt.xticks([]),plt.yticks([])
  • plt.subplot(rows, columns, index)  plt.subplot(121) means  total column counts is 1,  total row counts is 2, the current figure index is 1  
  • plt.xticks([]),plt.yticks([])  means  hide x and y axis and ticks