[R-SIG-Mac] Dashed line not evenly separated
jzh@ng @end|ng |rom m@th@m@@t@te@edu
Fri Feb 25 16:20:19 CET 2022
Thanks. I have tried the R-devel r81808 x86_64 and the plot has been improved significantly. The dashed lines are evenly separated as long as the window is reasonably large.
When the window is small, it still shows the same issue. The current one in r81808 is already good enough for me, I was wondering if it could be something like a well separated dashed line no matter the size of window.
Thanks again to others who confirmed and explored into this issue!
Jialin Zhang (JZ), Assistant Professor of Statistics
Department of Mathematics and Statistics
Mississippi State University
tel: (662) 325-7137; email: jzhang using math.msstate.edu<mailto:jzhang using math.msstate.edu>
From: Simon Urbanek <simon.urbanek using R-project.org>
Date: Thursday, February 24, 2022 at 7:57 PM
To: John Fox <jfox using mcmaster.ca>, Zhang, Jialin <jzhang using math.msstate.edu>
Cc: r-sig-mac using r-project.org <r-sig-mac using r-project.org>
Subject: Re: [R-SIG-Mac] Dashed line not evenly separated
FWIW I have checked the PDF, and it defines just one long path, so the rendering in Preview on macOS 11+ is simply wrong. It is rather curious that it is wrong in a way that is consistent with artificially breaking a path into subpaths internally - as if Apple was trying to do the same optimization that we did before and we do now know that it backfires ...
> On 25/02/2022, at 1:42 PM, Simon Urbanek <simon.urbanek using r-project.org> wrote:
> thanks, yes, interesting, the exact same PDF file looks just fine in macOS 10.15, but turns into solid line in macOS 11, so the problem has been introduced in PDF rendering between those macOS versions. I did not check the file so don't know whose rendering is correct.
> As for the Quartz device (Jialin's original question), we are splitting lines with many points into subpaths which means the dashing gets re-started at the beginning of each subpath. The current threshold is 100:
> The theory was that no one in their right mind would create a line that has 100 points so close to each other that they wouldn't even span a dash. I guess that assumption was wrong ;). If I recall paths with too many points caused a problem long time ago, but it may no longer be the case so removing the threshold altogether is another option. I have done that in r81808 so you can try tonight's R-devel which should no longer exhibit that behavior, but see if that causes any performance issues.
>> On 25/02/2022, at 4:40 AM, John Fox <jfox using mcmaster.ca> wrote:
>> Hi Duncan,
>> Your message prompted me to investigate a bit further, and I discovered that the pdf looks right when I open it in Adobe Reader or Google Chrome but not in the (default) macOS Preview or Safari. That suggests to me that the problem may be in macOS.
>> Just in case it's relevant, my session info:
>> R version 4.1.2 (2021-11-01)
>> Platform: aarch64-apple-darwin20 (64-bit)
>> Running under: macOS Monterey 12.1
>> Matrix products: default
>> BLAS: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRblas.0.dylib
>> LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
>>  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>> attached base packages:
>>  stats graphics grDevices utils datasets methods base
>> loaded via a namespace (and not attached):
>>  compiler_4.1.2
>> On 2022-02-24 6:10 a.m., Duncan Murdoch wrote:
>>> On 23/02/2022 8:30 p.m., John Fox wrote:
>>>> Dear Ken,
>>>> Yes, but I believe that it *should* work even in a small window. For
>>>> example, the following produces a proper broken line on Windows but not
>>>> on macOS:
>>>> pdf(width=3, height=3)
>>>> plot(log10(1:1e4), lty = 2, type="l")
>>> That one looks fine on my Mac in the PDF output, but not on screen using the default quartz() device.
>>> R version 4.1.0 Patched (2021-07-09 r80614)
>>> Platform: x86_64-apple-darwin17.0 (64-bit)
>>> Running under: macOS Catalina 10.15.7
>>> Duncan Murdoch
>> John Fox, Professor Emeritus
>> McMaster University
>> Hamilton, Ontario, Canada
>> web: https://secure-web.cisco.com/1ObjcIb3ZLRhGIdX1wQLJ_j0S1fGyZRimQTtMh_xiIUe13dTZayGXqBWe8LFrIEPvB-T_sZEPsk_FBkg4kaQE7uNLJykoRbr_-CRwMOI-llJmWRAwSzLBkUZHvAuphCJ0plh9iqmpT_FxSB8s2HlXzzynAe2a6Cl1PhEXorKeoIN3nVV35C2vpaC0j-FcIQQ4Mq0Tp0Ypqx-MnAzFgHNlZQlNRbXKHdgQZHwpmAWwjeT3GxSNl9Zg9_31egYHp2ikIFgINFS_q2atSugvI8pgtlndaNyJzbVIRg5TzGFmdQwBWjx3gw8JfLkQARVNoeT9/https%3A%2F%2Fsocialsciences.mcmaster.ca%2Fjfox%2F
>> R-SIG-Mac mailing list
>> R-SIG-Mac using r-project.org
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
[[alternative HTML version deleted]]
More information about the R-SIG-Mac