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

回答編集履歴

1

flip例を追記

2017/11/07 04:13

投稿

8524ba23
8524ba23

スコア38352

answer CHANGED
@@ -1,9 +1,13 @@
1
1
  `invert_yaxis`でもできるようです。
2
2
  参考:[Reverse Y-Axis in PyPlot](https://stackoverflow.com/questions/2051744/reverse-y-axis-in-pyplot)
3
3
 
4
+ 画像を逆転せずに表示させたい場合は[numpy.flip](https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.flip.html)で元データからひっくり返せばよいです。
5
+
4
6
  ```Python
7
+ im = np.flip(im,axis=0)
5
8
  # 略
6
9
  plt.subplot(1,2,1),plt.imshow(im,'gray')
7
10
  plt.gca().invert_yaxis()
8
11
  plt.title('output image')
9
- ```
12
+ ```
13
+ ![イメージ説明](2cd3c43052d75f528dd40a914d047b0a.png)