调用eulerr的plot()无欧拉图输出,示例代码也失效求助
plot() in RStudio on Mac OSX 10.12.6 Since your fit object returns valid stress and diagError values, the eulerr calculation itself is working correctly—we just need to fix the plotting display issue. Here are actionable steps to try:
Manually initialize the Mac graphics device
Older macOS versions sometimes have issues with RStudio's default plotting setup. Try opening Mac's native quartz device first before running the plot command:quartz() plot(fit)A separate window should pop up with your Euler diagram. If this works, you can set quartz as your permanent default device with
options(device = "quartz").Check RStudio's Plots panel
The plot might be generated but hidden in the panel. Click the "Clear All" button in the Plots tab, then re-runplot(fit). Also ensure the panel isn't minimized or tucked away in RStudio's layout.Try ggplot2-based plotting
Newer eulerr versions support generating plots via ggplot2, which can bypass grid device issues. Give this a shot:library(ggplot2) plot(fit, type = "ggplot")If this displays correctly, the problem is likely tied to your system's grid device configuration.
Fix version compatibility gaps
Your setup combines older software (RStudio 1.3.959, macOS 10.12.6) with a relatively new eulerr 6.1.0, which can cause conflicts:- Downgrade eulerr to a more stable, older release that’s better suited for your system. For example, install version 5.1.0:
install.packages("devtools") devtools::install_version("eulerr", version = "5.1.0") - Update RStudio to the latest version compatible with macOS 10.12.6 (RStudio 1.4.x is the last major release supporting Sierra). This can resolve underlying plotting engine bugs.
- Downgrade eulerr to a more stable, older release that’s better suited for your system. For example, install version 5.1.0:
Test in base R terminal
Run your code in the native R terminal (not RStudio). If the plot displays here, the issue is specific to RStudio’s configuration; if not, you may need to reinstall R or update your system’s graphics libraries.
内容的提问来源于stack exchange,提问作者justinian482

