我的 x 轴和 y 轴不可读。如何在轴上固定测量单位?

问题描述 投票:0回答:1

我的情节有点问题。由于我有这么多值,如何使 x 和 y 轴可读?我想在轴上固定一个测量单位。我该如何解决?

谢谢!

plt.scatter (mstar, sfr, color ='pink')
plt.xlabel('logmass')
plt.ylabel('logSFR')
plt.show()

x轴(mstar)上的数据为:['10.52', '9.473', '9.195', '10.11', '9.589', '10.19', '9.374', '10.05', '10.23', '10.74 '、'10.61'、'9.36'、'9.595'、'10.92'、'9.479'、'9.549'、'10.68'、'10.74'、'10.31'、'8.264'、'8.665'、'8.712'、 “9.203”、“8.914”、“9.81”、“10.54”、“10.13”、“9.81”、“9.87”、“9.86”、“9.27”、“9.08”、“8.78”、“9.62”、“9.23” '、'9.22'、'10.53'、'10.11'、'10.32'、'9.22'、'10.02'、'10.07'、'9.16'、'9.51'、'9.74'、'9.28'、'9.31'、 “9.96”、“9.91”、“9.49”、“9.27”、“9.26”、“8.96”、“8.75”、“7.49”、“8.9”、“9.2”、“9.46”、“9.12”、“8.69” '、'7.39'、'9.18'、'9.75'、'8.53'、'8.47'、'10.01'、'9.82'、'10.42'、'9.65'、'10.32'、'10.37'、'9.4'、 ‘10.89’, ‘11.34’]

y 轴(sfr)上的数据为:['0.6388', '-0.3744', '-0.4425', '-0.9009', '-0.9664', '0.05949', '-0.6335', '0.2962', ' -0.2829'、'0.3167'、'-0.9527'、'-0.5869'、'-1.206'、'0.3683'、'-1.68'、'-0.7564'、'-0.4969'、'0.113'、'0.2508'、 “-1.284”、“-1.755”、“-2.918”、“-0.5734”、“-2.139”、“0.1038”、“-0.04576”、“0.4784”、“-0.9566”、“0.2647”、“0.7604” , '0.02648', '0.1613', '-0.8109', '-0.01967', '-0.5942', '-0.1827', '0.2047', '0.6062', '-0.1293', '0.2303', '-1.000' , '0.08164', '0.09781', '0.302', '0.00731', '0.09938', '-0.08674', '0.02707', '0.3765', '0.01095', '0.1501', '-0.06735', '- 0.3979 ', '-1.0451', '-99', '-0.3586', '-0.5735', '-0.2420', '-99', '-0.5021', '-99', '-0.1549', '-0.2982 '、'-0.6214'、'-1.2541'、'-0.3312'、'0.06567'、'-0.6579'、'0.5253'、'0.6939'、'0.2118'、'0.2838'、'0.4153'、'-0.3508' ]

剧情就到这里了。 enter image description here

image plot scatter-plot axis
1个回答
0
投票

您可以尝试设置宽度和高度

width = 8
height = 6
plt.figure(figsize=(width, height))
© www.soinside.com 2019 - 2024. All rights reserved.