代码在下面:
import math, datetime
import rpy2.robjects.lib.ggplot2 as ggplot2
import rpy2.robjects as ro
from rpy2.robjects.packages import importr
from rpy2.robjects.packages import importr, data
datasets = importr('datasets')
mtcars = data(datasets).fetch('mtcars')['mtcars']
pp = ggplot2.ggplot(mtcars) + \
ggplot2.aes_string(x='wt', y='mpg', col='factor(cyl)') + \
ggplot2.geom_point() + \
ggplot2.geom_smooth(ggplot2.aes_string(group = 'cyl'),
method = 'lm')
pp.plot()
无响应,该图无法在交互式绘图设备中显示,我等待了很长时间,它显示了Traceback (most recent call last):File "D:\anacond\lib\asyncio\events.py", line 145, in _run self._callback(*self._args) File "D:\anacond\lib\asyncio\selector_events.py", line 141, in _read_from_self data = self._ssock.recv(4096) ConnectionResetError: [WinError 10054]