标签: scitools

Jupyter:安装新模块

我最近用Python 3.5和其他所有东西安装了Anaconda。我来自R,用于动态安装软件包。我正在尝试通过jupyter笔记本安装名为scitools的模块。我想在jupyter中重新创建它。但是,我不知道如何动态安装软件包(如果可能)。非常感谢您的帮助。谢谢!

在此处输入图片说明

编辑:我正在尝试使用社区推荐的conda,但是它不起作用。我正在使用Mac OSX

在此处输入图片说明

python anaconda scitools jupyter jupyter-notebook

4
推荐指数
2
解决办法
3万
查看次数

如何在 matplotlib 和 cartopy 中轻松添加具有适当位置和大小的 sub_axes?

我想在第一个轴的右上角添加第二个轴。谷歌搜索后,我找到了两种方法来做这样的事情:fig.add_axes(), 和mpl_toolkits.axes_grid.inset_locator.inset_axes. 但fig.add_axes()不接受transformarg。所以下面的代码会抛出一个错误。所以位置不能在父轴坐标下,而是在图形坐标下。

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig, ax = plt.subplots(1, 1, subplot_kw={'projection': ccrs.PlateCarree()})
ax2 = fig.add_axes([0.8, 0, 0.2, 0.2], transform=ax.transAxes, projection=ccrs.PlateCarree()) 
Run Code Online (Sandbox Code Playgroud)

并且inset_axes()不接受projectionarg,所以我不能添加ax2为 cartopy geo-axes。

from mpl_toolkits.axes_grid.inset_locator import inset_axes
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig, ax = plt.subplots(1, 1, subplot_kw={'projection': ccrs.PlateCarree()})

# The following line doesn't work
ax2 = inset_axes(ax, width='20%', height='20%', axes_kwargs={'projection': ccrs.PlateCarree()})
# Doesn't work neither:
ax2 …
Run Code Online (Sandbox Code Playgroud)

python matplotlib cartography cartopy scitools

3
推荐指数
1
解决办法
1789
查看次数