0

I have to plot alot data (300-1500 rows), i splitted the data into 350 rows each. I want to have zero distance (or small) between the left y axis and the first datapoint at 08:05:11. i tried alot but no idea anymore. I think it has something to do with the realy big figsize (sometimes i need 300,6)

please help

the plot as it is currently rendered

fig, host = plt.subplots(figsize=(70,6))

par1 = host.twinx()
host.grid(True)
host.plot(t1, s1, "bo", label="Status")
par1.plot(t1, e1, "r--", label="Event")
host.tick_params(axis='y', colors="blue")
host.set_ylim(3,-1)
host.set_ylabel("Status",fontsize=15,color="blue",)
host.tick_params(axis='x', colors="black",rotation=90)
host.set_xlabel("Timestamp: " + day,fontsize=15)
host.tick_params(axis='y', colors="blue",labelsize=20)
host.set_yticklabels(("Running", 'Unused', 'Problem'))

par1.set_ylim(2,-1)

par1.tick_params(axis='y', colors="red")
par1.yaxis.tick_left()
fig.tight_layout()

legend = host.legend(loc='upper left',bbox_to_anchor=(0.05, 1.00), shadow=True, fontsize='x-large')
legend2 = par1.legend(loc='upper left',bbox_to_anchor=(0.08, 1.00), shadow=True, fontsize='x-large')
legend.get_frame().set_facecolor('#c4c6c7')
legend2.get_frame().set_facecolor("#c4c6c7")
Petr Gladkikh
  • 1,906
  • 2
  • 18
  • 31
Eric Stralsund
  • 541
  • 1
  • 5
  • 17

1 Answers1

0

fixed i only had to set the xlim and than it was perfectly fitting

Eric Stralsund
  • 541
  • 1
  • 5
  • 17