rlbarter / superheat

An r package for generating beautiful and customizable heatmaps
https://rlbarter.github.io/superheat/
235 stars 29 forks source link

can not export a high res image #50

Closed akhst7 closed 4 years ago

akhst7 commented 4 years ago

I have not been able to export the high res image as follows:

>png(filename = "~/Desktop/image.png", res = 600)
>superheat(iris[,1:4], scale = F, clustering.method = "hierarchical", dist.method = "manhattan" ,pretty.order.rows = T,pretty.order.cols = T, col.dendrogram = T, row.dendrogram = T, bottom.label.text.angle = 90, force.left.label = T,bottom.label.text.size = 2 ,left.label.text.size = 1)
> dev.off()

packageVersion("superheat") [1] ‘0.1.0’


R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin18.7.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /usr/local/Cellar/openblas/0.3.7/lib/libopenblasp-r0.3.7.dylib

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] superheat_0.1.0     ggrepel_0.8.1       clusterSim_0.48-3   MASS_7.3-51.5       cluster_2.1.0       ggpubr_0.2.4       
 [7] magrittr_1.5        ggplot2_3.2.1       data.table_1.12.8   stringr_1.4.0       BiocManager_1.30.10 devtools_2.2.1     
[13] usethis_1.5.1      

loaded via a namespace (and not attached):
 [1] ggdendro_0.1-20         pkgload_1.0.2           tidyr_1.0.0             jsonlite_1.6            shiny_1.4.0            
 [6] assertthat_0.2.1        remotes_2.1.0           sessioninfo_1.1.1       pillar_1.4.3            backports_1.1.5        
[11] glue_1.3.1              digest_0.6.23           manipulateWidget_0.10.0 promises_1.1.0          ggsignif_0.6.0         
[16] R2HTML_2.3.2            colorspace_1.4-1        htmltools_0.4.0         httpuv_1.5.2            pkgconfig_2.0.3        
[21] purrr_0.3.3             xtable_1.8-4            scales_1.1.0            webshot_0.5.2           processx_3.4.1         
[26] later_1.0.0             tibble_2.1.3            farver_2.0.1            ellipsis_0.3.0          withr_2.1.2            
[31] lazyeval_0.2.2          cli_2.0.0               crayon_1.3.4            mime_0.8                memoise_1.1.0          
[36] ps_1.3.0                fs_1.3.1                fansi_0.4.0             class_7.3-15            pkgbuild_1.0.6         
[41] tools_3.6.2             prettyunits_1.0.2       lifecycle_0.1.0         munsell_0.5.0           callr_3.4.0            
[46] ade4_1.7-13             compiler_3.6.2          e1071_1.7-3             rlang_0.4.2             grid_3.6.2             
[51] rstudioapi_0.10         htmlwidgets_1.5.1       crosstalk_1.0.0         miniUI_0.1.1.1          labeling_0.3           
[56] testthat_2.3.1          gtable_0.3.0            R6_2.4.1                knitr_1.26              dplyr_0.8.3            
[61] zeallot_0.1.0           fastmap_1.0.1           rprojroot_1.3-2         desc_1.2.0              stringi_1.4.3          
[66] Rcpp_1.0.3              vctrs_0.2.1             rgl_0.100.30            tidyselect_0.2.5        xfun_0.11 ```
grownsdrinks commented 4 years ago

Hi,

I experienced this and discovered that it's an issue with how MacOS 'Preview' renders PNG and PDF files generated by superheat. In my case, simply opening them in other applications renders them as intended. Older versions of 'Preview' apparently had a toggle for disabling the smoothing feature responsible for blurring certain documents, however the preference option seems to have been removed.

Cheers