1

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.

IMAGE 1 - Chordpng.png IMAGE 1

IMAGE 2 - ChordpngCairo.png IMAGE 2

M_Shimal
  • 413
  • 3
  • 12
  • I am ok with the different colour scheme inconsistency. I am sure that unfilled/white part does't come from colour scheme but the same diagram has it filled(like a mountain) when saved with `type="cairo-png"` – M_Shimal Dec 27 '17 at 17:48
  • I have tried both devices on my laptop and the plots look similar (https://drive.google.com/open?id=18A57F5TAoBK9r1dSAmlogCEnh74xlXyp). Can you try it with the recently version of circlize (0.4.*)? – Zuguang Gu Jan 10 '18 at 11:13
  • @ZuguangGu Tried with circlize version 0.4.3. It gives the same result as above. I did try on a Mac, with the circlize 0.4.3, and quartz also gives out the same result. – M_Shimal Jan 21 '18 at 16:25

0 Answers0