文章詳情頁
python - 關(guān)于matplotlib的x軸顯示的問題
瀏覽:186日期:2022-06-26 18:33:28
問題描述
最近學(xué)pandas和數(shù)據(jù)可視化,做的練手程序
#coding:utf-8 import tushare as ts import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdate ......fig1 = plt.figure(figsize=(15,5)) ax1.xaxis.set_major_formatter(mdate.DateFormatter(’%H:%M’))#設(shè)置時(shí)間標(biāo)簽顯示格式 plt.xticks(pd.date_range(start=’09:00’,end=’09:10’,freq=’60S’),rotation=90) plt.title(’percent’) plt.plot(real_data_ave,’.-’) plt.show()
問題是我這樣做,X軸看不到時(shí)間是幾點(diǎn)幾分,怎么解決?
問題解答
回答1:ax1是什么東西?沒定義啊~
相關(guān)文章:
1. css - 移動(dòng)端 oppo 手機(jī)之 Border-radius2. javascript - vue提示語法錯(cuò)誤,請(qǐng)問錯(cuò)誤在哪?3. 淺談vue生命周期共有幾個(gè)階段?分別是什么?4. index.php錯(cuò)誤,求指點(diǎn)5. python - 抓包只抓到j(luò)son,真實(shí)的地址卻找不到6. css - 關(guān)于偽類背景問題7. html - JavaScript的Dom操作如何改變子元素的文本內(nèi)容8. java - web端百度網(wǎng)盤的一個(gè)操作為什么要分兩次請(qǐng)求服務(wù)器, 有什么好處嗎9. javascript - 為什么我的animation-fill-mode 設(shè)置不生效10. javascript - vue.js如何遞歸渲染組件.
排行榜

熱門標(biāo)簽