r - R 将绘图保存在 png 中,但不保存在 pdf 中
问题描述
我正在尝试将玩具图保存在文件中。它适用于png,但不适用于pdf。pdf只是空的。
width = 1144
height = 995
png("deleteme.png", width = width, height = height)
op=par(mar = c(0, 0, 0, 0))
plot(c(0, width), c(0, height), type = "n", xlab = "", ylab = "",xaxs = "i",yaxs = "i")
lines(c(1,2,3,4)*100, c(3,2,3,5)*100)
dev.off()
pdf("deleteme.pdf", width = width, height = height)
op=par(mar = c(0, 0, 0, 0))
plot(c(0, width), c(0, height), type = "n", xlab = "", ylab = "",xaxs = "i",yaxs = "i")
lines(c(1,2,3,4)*100, c(3,2,3,5)*100)
dev.off()
这是pdf:http ://docdro.id/wG9xx3J
pdf 显示 chrome 中的行,但不在 Acrobat 中!
解决方案
推荐阅读
- json - 如何从DetailedResponse 对象中获取“成绩单”数据?
- networking - 在使用 GCP Compute Engine 时无法查看 Apache Airflow GUI
- python - OpenCV blob 检测器未检测到白色 blob
- c - Visual Studios 给我取消引用空指针警告
- amazon-web-services - 当我尝试通过 AWS 中的 vpclink(API 网关)连接到它时,如何修复来自 vpc 中 NLB 的 500 响应
- android - 如何在 Firebase 实时数据库中找到给定 JSON 树中描述的指定数据?
- node.js - 前端的 Axios 请求不会从后端的 MongoDB 数据库加载我需要的数据
- c++ - 基于范围的 std::move 意外调用复制构造函数
- javascript - 基于html标签/其他无ASP的选择性浏览器缓存(即甜甜圈)?
- c++ - C++ grpc::experimental:interceptor 如何从自定义拦截器返回状态和消息