X轴刻度间距

2024-09-28 23:44:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在格式化我的x轴。你知道吗

我有585590595605的值。我已经取消了600分,但现在我有一个巨大的差距。有什么办法可以让你看起来干净点?你知道吗

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

Tabelle = pd.read_excel(
    "C:\\Users\\alexk\\Dropbox\\WW\\WW Master\\1. Semester\\WW2\\WW2 Kernfachpraktikum\\KFP2\\Ergebnisse.xlsx",
    "Auswertung Zugversuche T-d")

T = Tabelle["T./°C"]

y = Tabelle["MW. Rp0,2"]
y2 = Tabelle["MW. Rm"]
y3 = Tabelle["MW. e"]

z1 = Tabelle["StabW. Rp0,2"]
z2 = Tabelle["StabW. Rm"]
z3 = Tabelle["StabW. Rm"]

fig = plt.figure()

ax1 = fig.add_subplot(1, 2, 1)

ax1.bar(T, y, label=("Rp0,2")), ax1.bar(T, y2, label=("Rm"))
ax1.set_title("Titel")
ax1.set_xlabel("Gießtemperatur / °C")
ax1.set_ylabel("Rp0,2 und Rm / MPa")
ax1.set_ylim(0, 250)

ax1.set_xticks(T)
# Values in T:585,590,595,605

plt.legend()
plt.show()

目前情况就是这样:

enter image description here


Tags: rmimportasfigpltmwpdset