I don't say much nonsense , Look at the renderings first :
The following only discusses how to realize matplotlib The scale in the drawing faces inward , Other settings such as fonts 、 The coordinate axis is not considered .
The following code is based on :
python edition 3.6.10
numpy edition 1.19.3
matplotlib edition 3.2.1
import numpy as np
import matplotlib.pyplot as plt
nums = np.arange(10).reshape(2,5)
x = nums[0]
y = nums[1]
plt.figure()
plt.plot(x,y)
plt.savefig("1.png",dpi=600)
import numpy as np
import matplotlib.pyplot as plt
nums = np.arange(10).reshape(2,5)
x = nums[0]
y = nums[1]
plt.figure()
plt.rcParams['xtick.direction']='in'
plt.rcParams['ytick.direction']='in'
plt.plot(x,y)
plt.savefig("1_post.png",dpi=600)
The main setting is plt.plot(x,y) Previously set the scale direction :
plt.rcParams['xtick.direction']='in'
plt.rcParams['ytick.direction']='in'
Reference resources :
https://zhuanlan.zhihu.com/p/448571003
https://wenku.baidu.com/view/d63d7f7cbd23482fb4daa58da0116c175e0e1e5a.html