【したいこと】
Y軸を最小値0、最大値2000、間は100ずつなどの設定をしたい。
現状250ずつですが、100ずつなど自分の指定でしたい。
【エラーメッセージ】
plt.yticks(0:25:100)を試して見ましたが、Invalidでエラーでした。
figure_ = plt.figure(figsize=(12,4)) axes_ = figure_.add_subplot(121) axes_.plot(x, y, 'o-') axes_.set_title('Daily_Spend') axes_.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, loc: "{:,}".format(int(x)))) plt.xticks(x, rotation=90) plt.legend(['Spend']) #二つ目のグラフ figure_1 = plt.figure(1, figsize=(12,3)) axes_1= figure_.add_subplot(122) axes_1.plot(x1, y1, 'o-') axes_1.set_title('Daily_CPI') axes_1.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, loc: "{:,}".format(int(x)))) plt.xticks(x, rotation=90) #plt.yticks(0:25:100) plt.ylim(0,2000) plt.legend(['CPI']) plt.show()
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/09 03:24