0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Matplotlib で画像に等高線を描画したいがうまくいかないメモ

Posted at

ありがとうございます.

%matplotlib widget
import matplotlib.pyplot as plt


fig, ax = plt.subplots()
im = ax.contour(image, levels=np.linspace(0, 100, 10), alpha=0.5)
plt.show()

ただし, こちらで試した限りでは(jupyterlab + widget magic で表示), なぜか画像の上下が逆になりました.
また, contour だと等高線だけしか描画されない.
Matplotlib のバグ?

とりあえずは contourf で fill した画像で凌ぐしかなさそうです...

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?