talgalili / gplots

13 stars 6 forks source link

Color key in heatmap.2() appears "washed out" #6

Open andrewjyee opened 3 years ago

andrewjyee commented 3 years ago

This has also been posted in https://stackoverflow.com/questions/67680197/odd-appearance-of-colors-with-viridis-in-pdfs-viewed-by-preview-v-adobe

The color key created by heatmap.2() in a PDF appears "washed out" when viewed by Preview in MacOS X, but not in Adobe Acrobat.

I'm using the viridis() color scale. I used pdf() to create the output.

I don't know if this is an issue that's related to Preview in MacOS X or is related to heatmap.2()?

The follow code generates the PDF where I see this issue.

library ('viridis')
library('gplots')
test.matrix <- matrix(ncol=25, nrow=9, -4:4)
breaks <- seq(-4,4,0.5)
pdf(file='heatmap.pdf', width=10, height=6)
heatmap.2(test.matrix, density.info = 'none',  trace='none', 
  Colv = F, Rowv = F, dendrogram = 'none', 
  col=viridis(length(breaks)-1), breaks=breaks 
          )
dev.off()
talgalili commented 3 years ago

Hey, I'm currently in maintenance mode of the package. So don't plan to dig into this. But if you find code that should be fixed and submit a PR, I'd be happy to review it.

With regards, T

On Sun, Jun 6, 2021 at 2:51 PM andrewjyee @.***> wrote:

This has also been posted in https://stackoverflow.com/questions/67680197/odd-appearance-of-colors-with-viridis-in-pdfs-viewed-by-preview-v-adobe

The color key created by heatmap.2() in a PDF appears "washed out" when viewed by Preview in MacOS X, but not in Adobe Acrobat.

I'm using the viridis() color scale. I used pdf() to create the output.

I don't know if this is an issue that's related to Preview in MacOS X or is related to heatmap.2()?

The follow code generates the PDF where I see this issue.

library ('viridis') library('gplots') test.matrix <- matrix(ncol=25, nrow=9, -4:4) breaks <- seq(-4,4,0.5) pdf(file='heatmap.pdf', width=10, height=6) heatmap.2(test.matrix, density.info = 'none', trace='none', Colv = F, Rowv = F, dendrogram = 'none', col=viridis(length(breaks)-1), breaks=breaks ) dev.off()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/talgalili/gplots/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHOJBVPHIDV6W7Q5H2HMTLTRNOLHANCNFSM46F3H2AA .