> plot_grid(p1, p2, ncol = 2, align = "h", axis = "tb") Error in `geom_boxplot()`: ! Problem while computing aesthetics. ℹ Error occurred in the 1st layer. Caused by error in `FUN()`: ! object 'Sepal.Length' not found Run `rlang::last_trace()` to see where the error occurred.
时间: 2023-12-06 19:42:32 浏览: 43
这个错误提示说找不到 `Sepal.Length` 这个对象,很可能是因为 `Sepal.Length` 这个变量名没有定义或者拼写错误。请检查一下代码中是否有定义这个变量,或者确认变量名是否正确。如果问题仍然存在,可以使用 `rlang::last_trace()` 命令来查看错误的具体位置和原因。
相关问题
totalplot<-cowplot::plot_grid(plotlist=plotlist,ncol=1) Error in `geom_line()`: ! Problem while computing aesthetics. ℹ Error occurred in the 2nd layer. Caused by error in `FUN()`: ! object 'EMD' not found Run `rlang::last_trace()` to see where the error occurred.
根据错误提示,似乎出现了一个"EMD not found" 的错误,可能是由于没有加载或者创建 `EMD` 对象。你需要检查一下代码中是否有创建 `EMD` 对象的语句,或者在运行这段代码之前是否已经加载了包含 `EMD` 对象的数据或者文件。同时,你也可以运行 `rlang::last_trace()` 命令来查看更详细的错误信息,以便更好地定位问题所在。
ax.plot_surface(grid_x, grid_y, grid_z, facecolors=plt.cm.jet(grid_c), alpha=0.5)报错 Argument Z must be 2-dimensional.
这个错误提示是因为参数 Z 必须是一个二维数组,而你传入的 grid_z 可能是一个一维数组或者不是二维的二维数组。要解决这个问题,可以将 grid_z 转换成二维数组,例如通过 numpy 库的 reshape() 函数来实现:
```
import numpy as np
grid_z = np.reshape(grid_z, (len(grid_x), len(grid_y)))
ax.plot_surface(grid_x, grid_y, grid_z, facecolors=plt.cm.jet(grid_c), alpha=0.5)
```
这样就可以将 grid_z 转换成与 grid_x 和 grid_y 一样的二维数组,从而避免了 "Argument Z must be 2-dimensional" 的错误提示。