代码之家  ›  专栏  ›  技术社区  ›  highBandWidth

R以png格式保存绘图,但不以pdf格式保存

  •  1
  • highBandWidth  · 技术社区  · 8 年前

    我想把一个玩具情节保存在一个文件里。它适用于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()
    

    这是png: enter image description here

    http://docdro.id/wG9xx3J

    pdf在chrome中显示行,但在Acrobat中不显示!

    0 回复  |  直到 8 年前