我想在38个位置上放置38个,但距离应该相同,我使用了matplot库
,图形看起来像是直线峰会消失# -*- coding: utf-8 -*-
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
s=['05/02/2019', '06/02/2019', '07/02/2019', '08/02/2019', '09/02/2019', '10/02/2019', '11/02/2019', '12/02/2019', '13/02/2019', '20/02/2019', '21/02/2019', '22/02/2019', '23/02/2019', '24/02/2019', '25/02/2019']
df[0]=['38.02'
,'33.79'
,'34.73'
,'36.47'
,'35.03'
,'33.45'
,'33.82'
,'33.38'
,'34.68'
,'36.93'
,'33.44'
,'33.55'
,'33.18'
,'33.07'
,'33.17'
]
# Data for plotting
fig, ax = plt.subplots(figsize=(17, 2))
for i,j in zip(s,df[0]):
ax.annotate(str(j),xy=(i,j+0.8))
ax.plot(s, df[0])
ax.set(xlabel='Dates', ylabel='Latency',
title='Hongkong to sing)
ax.grid()
#plt.yticks(np.arange(min(df[p]), max(df[p])+1, 2))
fig.savefig("test.png")
#plt.show()