teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

コードのコメント間違いを修正

2020/04/04 03:39

投稿

magichan
magichan

スコア15898

answer CHANGED
@@ -3,11 +3,11 @@
3
3
  [https://matplotlib.org/3.1.1/api/ticker_api.html#matplotlib.ticker.FuncFormatter](https://matplotlib.org/3.1.1/api/ticker_api.html#matplotlib.ticker.FuncFormatter)
4
4
 
5
5
  ```Python
6
- # X軸の数字が必ず整数になるようにする
6
+ # Y軸の数字が必ず整数になるようにする
7
7
  plt.gca().get_yaxis().set_major_locator(ticker.MaxNLocator(integer=True))↓
8
8
  ```
9
9
 
10
10
  ```Python
11
- # X軸の数字を float型からint型に変換する
11
+ # Y軸の数字を float型からint型に変換する
12
12
  plt.gca().get_yaxis().set_major_formatter(ticker.FuncFormatter(lambda v,p:int(v)))
13
13
  ```