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

R图PNG渲染真实数据模糊,小数据清晰

  •  0
  • thevikas  · 技术社区  · 6 年前

    我正试着用R做一个蜡烛图。

    在我的5米蜡烛图示例中,正确整洁地渲染成PNG。如下图所示:

    good chart

    但当我给它提供一周500万烛光数据的真实数据时, 图表呈现如下模糊:

    bad chart

    我使用的代码部分:

    png( labels$pngfile, height=labels$height,width=labels$width)
    par(mar=c(12,6,3,6))
    plot( df$high, main=labels$title, xaxt="n", xlab="", ylab="price", ylim=c( mn, mx ), type="n",las=1 ) 
    par( new=T )
    plot( df$low, main="", axes=F, xlab="", ylab="", ylim=c( mn, mx ), type="n" ) 
    segments( x0=xs, y0=df$open, x1=xs, y1=df$close, col=color_list, lwd=4 ) 
    segments( x0=xs, y0=df$low, x1=xs, y1=df$high, col=color_list, lwd=1 ) 
    dev.off()
    

    请建议如何修复模糊。 谢谢。

    0 回复  |  直到 6 年前
    推荐文章