【问题标题】:Problem with resource files with PyNGL/PyNioPyNGL/PyNio 的资源文件问题
【发布时间】:2019-07-18 09:29:57
【问题描述】:

我正在尝试将代码从 NCL 转换为 PyNGL/PyNio。正如我所读到的on the transition guide,绘图例程的资源文件的处理应该与 NCL 中的工作方式相同。但是,在我的脚本中,python 没有 包括资源文件中的任何资源,即使我遵循转换指南中的基本示例。这可能是因为我在 conda 环境中工作吗?还是 PyNGL 有 bug?

我在 Conda 环境中使用 Python 3.7。我已经用我自己的代码以及下面包含的一个非常简单的示例代码进行了尝试。

#THIS IS THE CODE IN THE MAIN FILE: 
import Ngl

wks = Ngl.open_wks("png","title_app")

plot = Ngl.text_ndc(wks,"Hello, World",0.5,0.5)

Ngl.frame(wks)
Ngl.end()

#THIS IS TE CODE IN THE FILE IN THE SAME FOLDER NAMED title_app.res

*txFontColor   : red
*txFont        : helvetica-bold
*txFontHeightF : 0.06

出现在文件 title_app.png 中的文本既不显示为红色也不显示为粗体。

【问题讨论】:

    标签: python anaconda conda resource-files ncl


    【解决方案1】:

    您必须先安装软件包。建议创建一个新的 conda 环境。你试过conda create --name pyn_env --channel conda-forge pyngl 后跟conda activate pyn_env 吗?检查their own documentation on this matter

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-21
      • 1970-01-01
      相关资源
      最近更新 更多