此问题在此处已有答案:
Matplotlib so log axis only has minor tick mark labels at specified points. Also change size of tick labels in colorbar(2个答案)
Matplotlib semi-log plot: minor tick marks are gone when range is large(5个答案)
kilo (K) and mega (M) suffixes on matplotlib's axes(2个答案)
Make tick labels font size smaller(10个答案)
Rotate axis tick labels(13个回答)
16天前关闭
我正试着画一个x轴是对数的xy图。我使用这个命令:
import matplotlib as plt
plt.plot(X,Y)
plt.xscale('log')
字符串
x轴是对数的,但只有10的倍数的值才显示在图形中,但我需要在图形中显示所有网格线的值。
的数据
如图所示,x轴上只显示10^6
,但我需要显示其他点的值。
1条答案
按热度按时间3npbholx1#
*在
python 3.11.4
、matplotlib 3.7.1
中测试subs
(例如:subs=[.2, .4, .6, .8]
)。字符串
的数据
.set_minor_formatter
个.set_major_formatter
个x
和y
,设置次要刻度标签格式和字体大小,可以改善视觉体验。型
的
型
的