I've made a chord diagram (from circlize package) for population movement and when I tried saving it using type="cairo-png"
from png()
device, it gives me a different one to the default png()
device or the one seen from R studio plot panel. Below is the issue presented with some random data. I could do with using default png()
but would really appreciate help on why this inconsistent behavior exist and how to resolve it?
'#
R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
PackageVersion:
circlize_0.3.10
'#
require(circlize)
chord_df <- data.frame(from=rep(LETTERS[1:5], each=5),
to=rep(LETTERS[1:5], 5),
value=as.integer(runif(25,50,100)))
chordDiagram(chord_df, self.link = 1, directional = 1)
#IMAGE 1 - how I want the chord diagram to be
png(filename = "Chordpng.png")
chordDiagram(chord_df, self.link = 1, directional = 1)
dev.off()
#IMAGE 2 - The same chord diagram is different though when type="cairo-png" in png device
png(filename = "ChordpngCairo.png", type = "cairo-png")
chordDiagram(chord_df, self.link = 1, directional = 1)
dev.off()
The inconsistency I note here is the unfilled and filled part of the second inner part of the circle, not the colour scheme.