在基本的R图形中,是否可以找到添加矩形的确切位置? [英] In base R graphics, is it possible to find exact placing of the added rectangles?
问题描述
关于试图复制复杂图形I,继续阅读此问题我正在使用托马斯' 挖掘我发现了一个添加选项例如: 然而 - 必须选择上限和下限(耐心;)主要是通过试验和错误。 有没有办法添加一些automa 建立您的解决方案: Following up this question on an attempt to reproduce the complex graph I am working with Thomas' solution. All works exactly as specified but I was wondering if there is an option to add transparent grey shading to alternate 'rows' of the graph, similarly as it is done in the original version provided by OP. Digging around I've found an option to add transparent rectangle covering specified area, for instance: However - the upper and lower limits have to be chosen (with patience ;) largely by trial and error. Is there a way to add some automation to this process? Building on your solution:
这篇关于在基本的R图形中,是否可以找到添加矩形的确切位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
rect(-10,2.8,12,3.3,col =#00000025 ,border = NA)
shaded_rowseq <-rowseq [rep(c(T,F),length(rowseq)/ 2)]
rect(-10,shaded_rowseq-0.5,12,shaded_rowseq + 0.5 ,col =#00000025,border = NA)
rect(-10, 2.8, 12, 3.3, col="#00000025", border=NA)
shaded_rowseq <- rowseq[rep(c(T,F),length(rowseq)/2)]
rect(-10, shaded_rowseq-0.5, 12, shaded_rowseq+0.5, col="#00000025", border=NA)