[Rd] svg ignores cex.axis in R3.5.1 on macOS

Prof Brian Ripley ripley @ending from @t@t@@ox@@c@uk
Thu Sep 6 12:17:18 CEST 2018


On 06/09/2018 10:47, peter dalgaard wrote:
> I think this needs to be taken off the bug repository and continued here. By now it seems pretty clear that this is not an R bug, but a local problem on Spencer's machine, likely connected to font configurations.

Or even on R-sig-Mac.

> I poked around a bit on the three Macs that I can access, and found that fc-match does different things, including throwing warnings, hanging and even crashing my old MB Air...
> 
> One possible reason is that it can apparently be installed in multiple locations, for reasons lost in the mists of time:
> 
> Peters-iMac:BUILD-dist pd$ ls -l /opt/local/bin/fc-*
> -rwxr-xr-x  1 root  wheel  44072 Apr  5  2014 /opt/local/bin/fc-cache
> -rwxr-xr-x  1 root  wheel  43444 Apr  5  2014 /opt/local/bin/fc-cat
> -rwxr-xr-x  1 root  wheel  34480 Apr  5  2014 /opt/local/bin/fc-list
> -rwxr-xr-x  1 root  wheel  34928 Apr  5  2014 /opt/local/bin/fc-match
> -rwxr-xr-x  1 root  wheel  34480 Apr  5  2014 /opt/local/bin/fc-pattern
> -rwxr-xr-x  1 root  wheel  34008 Apr  5  2014 /opt/local/bin/fc-query
> -rwxr-xr-x  1 root  wheel  34448 Apr  5  2014 /opt/local/bin/fc-scan
> -rwxr-xr-x  1 root  wheel  38780 Apr  5  2014 /opt/local/bin/fc-validate
> Peters-iMac:BUILD-dist pd$ ls -l /opt/X11/bin/fc-*
> -rwxr-xr-x  1 root  wheel  58128 Oct 26  2016 /opt/X11/bin/fc-cache
> -rwxr-xr-x  1 root  wheel  57600 Oct 26  2016 /opt/X11/bin/fc-cat
> -rwxr-xr-x  1 root  wheel  48384 Oct 26  2016 /opt/X11/bin/fc-list
> -rwxr-xr-x  1 root  wheel  48992 Oct 26  2016 /opt/X11/bin/fc-match
> -rwxr-xr-x  1 root  wheel  44256 Oct 26  2016 /opt/X11/bin/fc-pattern
> -rwxr-xr-x  1 root  wheel  44000 Oct 26  2016 /opt/X11/bin/fc-query
> -rwxr-xr-x  1 root  wheel  44288 Oct 26  2016 /opt/X11/bin/fc-scan
> -rwxr-xr-x  1 root  wheel  48608 Oct 26  2016 /opt/X11/bin/fc-validate
> Peters-iMac:BUILD-dist pd$ ls -l /usr/local/bin/fc-*
> -rwxr-xr-x@ 1 root  wheel  1463900 Oct 21  2008 /usr/local/bin/fc-cache
> -rwxr-xr-x@ 1 root  wheel  1459780 Oct 21  2008 /usr/local/bin/fc-cat
> -rwxr-xr-x@ 1 root  wheel  1455628 Oct 21  2008 /usr/local/bin/fc-list
> -rwxr-xr-x@ 1 root  wheel  1476560 Oct 21  2008 /usr/local/bin/fc-match
> 
> Notice that these are all different, no links. I guess that the ones you want are in /opt/X11, presumably installed by XQuartz.

Yes, for the device compiled into the CRAN binary R package.  (Other 
builds may differ.)  On that, the cairo-based devices such as svg() are 
linked to (current versions on my machine)

	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
	/opt/X11/lib/libcairo.2.dylib (compatibility version 11403.0.0, current 
version 11403.6.0)
	/opt/X11/lib/libpixman-1.0.dylib (compatibility version 35.0.0, current 
version 35.0.0)
	/opt/X11/lib/libfontconfig.1.dylib (compatibility version 11.0.0, 
current version 11.2.0)
...


> So, going out on a limb, I have two ideas:
> 
> (A) Rebuild the font cache with
> 
> /opt/X11/bin/fc-cache -vf
> 
> (B) Check that XQuartz is up to date (possibly reinstall it, even if it is)

(B) is expected to do (A).  My advice was going to be to reinstall 
xquartz: macOS updates can partially break it.

> 
> -pd
> 
>> On 5 Sep 2018, at 21:13 , MacQueen, Don via R-devel <r-devel using r-project.org> wrote:
>>
>> Seems ok on my system. Axis label size changes when cex.axis does.
>>
>> ## tested in the middle of another long session, so many additional packages are attached, including some personal packages not available elsewhere
>>
>>> sessionInfo()
>> R version 3.5.1 (2018-07-02)
>> Platform: x86_64-apple-darwin15.6.0 (64-bit)
>> Running under: macOS High Sierra 10.13.6
>>
>> Matrix products: default
>> BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
>> LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
>>
>> locale:
>> [1] C
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] survival_2.42-3 ROracle_1.3-1   DBI_1.0.0       bookdown_0.7    knitr_1.20      rmarkdown_1.10  wdr_3.2         taurus_3.2-4    xlsx_0.6.1
>> [10] rmacq_1.3-8
>>
>> loaded via a namespace (and not attached):
>> [1] Rcpp_0.12.17    magrittr_1.5    splines_3.5.1   lattice_0.20-35 highr_0.7       stringr_1.3.1   tools_3.5.1     grid_3.5.1      xfun_0.3
>> [10] tinytex_0.6     htmltools_0.3.6 yaml_2.1.19     rprojroot_1.3-2 digest_0.6.15   zip_1.0.0       Matrix_1.2-14   rJava_0.9-10    xlsxjars_0.6.1
>> [19] evaluate_0.10.1 openxlsx_4.1.0  stringi_1.2.3   compiler_3.5.1  backports_1.1.2
>>
>> --
>> Don MacQueen
>> Lawrence Livermore National Laboratory
>> 7000 East Ave., L-627
>> Livermore, CA 94550
>> 925-423-1062
>> Lab cell 925-724-7509
>>
>>
>>
>> On 8/31/18, 1:02 PM, "R-devel on behalf of Spencer Graves" <r-devel-bounces using r-project.org on behalf of spencer.graves using prodsyse.com> wrote:
>>
>>
>>
>>     On 2018-08-31 14:21, Spencer Graves wrote:
>>> Plots produced using svg in R 3.5.1 under macOS 10.13.6 ignores
>>> cex.axis=2.  Consider the following:
>>>
>>>
>>>> plot(1:2, cex.axis=2)
>>>> svg('svg_ignores_cex.axis.svg')
>>>> plot(1:2, cex.axis=2)
>>>> dev.off()
>>>> sessionInfo()
>>> R version 3.5.1 (2018-07-02)
>>> Platform: x86_64-apple-darwin15.6.0 (64-bit)
>>> Running under: macOS High Sierra 10.13.6
>>>
>>> Matrix products: default
>>> BLAS:
>>> /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
>>> LAPACK:
>>> /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
>>>
>>> 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
>>>
>>> loaded via a namespace (and not attached):
>>> [1] compiler_3.5.1
>>>
>>>
>>>       ** The axis labels are appropriately expanded with the first
>>> "plot(1:2, cex.axis=2)".  However, when I wrote that to an svg file
>>> and opened it in other applications (GIMP and Safari), the cex.axis
>>> request was ignored.  This also occurred inside RStudio on my Mac. It
>>> worked properly using R 3.2.1 under Windows 7.
>>
>>
>>     I just confirmed that when I created a file like this under Windows 7
>>     and brought it back to my Mac, it displayed fine.  I have not tried this
>>     with the current version of R under Windows 7 nor an old version of R on
>>     my Mac.  Thanks.  Spencer
>>>
>>>
>>>       Thanks,
>>>       Spencer Graves

-- 
Brian D. Ripley,                  ripley using stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford



More information about the R-devel mailing list