- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试在 photutil 中运行示例
一切正常,除了线路
plt.imshow(image, cmap='gray_r', origin='lower')
这不会引发异常但不会显示图像。我用的是 eric ide。
最佳答案
之后你需要调用plt.show()
。
来自Matplotlib FAQ :
When you want to view your plots on your display, the user interface backend will need to start the GUI mainloop. This is what show() does. It tells matplotlib to raise all of the figure windows created so far and start the mainloop. Because this mainloop is blocking by default (i.e., script execution is paused), you should only call this once per script, at the end. Script execution is resumed after the last window is closed.
关于python - 将 matplotlib.pylab 的 imshow 与 python ide 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34742842/
我注意到pylab中有一些名称重复。假设我导入 pylab。以下是一些示例: 例如1: pylab.ion() pylab.plt.ion() 例如2 pylab.figure(1) pylab.pl
我希望情节线覆盖文本。这是当前代码: pylab.plot( data[:,0], data[:,1], color='red', lw=3, label='Temp' ) pylab.figtext
这个问题在这里已经有了答案: pylab.ion() in python 2, matplotlib 1.1.1 and updating of the plot while the program
我正在使用 pylab 绘制一些数据,一切都按我的预期完美运行。我有 6 个不同的图表要绘制,我可以将它们单独绘制在单独的图中。但是当我尝试 subplot() 这些图表时,最后一个 (subplot
我有两个数组 x、y 以及函数的坐标。 示例: x=[0,1,2,3,4,5] y=[0,1,5,20,30,32] pylab.plot(x,y) 向我展示了一个平滑的函数。 有没有办法获取y=3的
我正在使用以下代码制作一个非常简单的 pandas/pylab 条形图: df2 = pd.DataFrame(np.random.rand(10, 4), columns=['a', 'b', 'c
我正在使用 PyBrain,在文档中它使用 PyLab...我尝试导入 PyLab 并且它有效,但是当我尝试使用其中的任何模块时,python 返回错误。 >>> import pylab
我需要修改我的图例。 noise_mu 具有诸如 1.6e-29 之类的值,我希望它能够以科学的方式准确绘制。不幸的是,我的图例总是以 0.000000000000000000000016 的形式打印
我有一个 mac OS X Yosimite,我使用 python 2.7.10 和 Pycharm 作为我的 IDLE。我已经正确安装了 pylab,但无法使用它的任何模块。 尝试时: from p
我正在尝试关注 this PCA tutorial并且在尝试使用 启动 pylab 时遇到了障碍 $pylab inline 我在哪里遇到语法错误。我正在使用 Anaconda/Spyder 和 Py
我正在使用 PyLab 在 Python 中制作一些图表。我想制作一个带有黑色文本的洋红色文本框,但无法将文本变为黑色。 text(x, y, 'Summary', backgroundcolor =
我访问了scipy site for PyLab.我在那里找不到它的文档。 matplotlib site也没有提供任何关于它的信息。 我在哪里可以找到 PyLab 的教程/文档? 最佳答案 Pyla
我确定这是一个非常基本的问题,但我似乎找不到正确的代码。我正在创建的箱线图有我的代码。我想标记轴并有一个标题。 from pylab import * import numpy raw_data =
我不断看到人们在各种代码片段中使用 %pylab,尤其是使用 iPython。但是,我看不到“学习 Python”(以及我拥有的其他几本 Python 书籍)中的任何地方提到了 %pylab,也不确定
我已经在 Mac (OSX Lion) 上安装了 iPython + SciPy Superpack。 如果我使用 matplotlib.pyplot 绘图,它会弹出一个带有图形的窗口,我关闭它以便
我有用于绘制以下捕食者猎物模型的代码: dx/dt = x − xy, dy/dt = −y + xy from pylab import * xvalues, yvalues = meshgrid(
我正在绘制图表并使用 pylab.poly1d 函数绘制最佳拟合线。但最佳拟合线不够长。我怎样才能延长这条线。这是我的代码: y=np.genfromtxt('_02total.txt').T[0]
我正在尝试绘制方波的傅立叶序列,但是对于许多项,该程序需要太多时间来计算所有点。我尝试使用多处理模块但没有成功。请帮助我如何使用多处理。我正在 fedora linux 上运行,并拥有 AMD FX
我有一个小代码,用此代码生成以下图片: 代码1: hist, rhist = np.histogram(r, bins=40, range=(0, 0.25)) hist = -hist/np.tra
是否可以使 pylab.show() 不会忘记? 我的意思是这样的: x = np.linspace(0, 10, 1000) y = np.sin(x) pylab.plot(x, y) pylab
我是一名优秀的程序员,十分优秀!