X轴刻度间距

时间:2018-11-22 15:51:34

标签: python matplotlib

我正在尝试格式化我的x轴。

我的数值为585,590,595,605。我已经消除了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

0 个答案:

没有答案
相关问题