Thank you all for your help. I am using Windows. I ran the following both
in R 4.2.2 using RStudio and not using RStudio (but using the R GUI). In
both runs, plots within the GUI/RStudio and in the PNG output exhibited the
same issue that I reported originally., whereas plots in the PDF output
were perfect (no issue).
As asked, the first dev.cur() or .Device says "null device" whereas
the
second says "Windows" when using the R GUI and "RStudioGD"
when using
RStudio.
It sounds like this is likely a windows-related bug that will be fixed in
the next version. I can wait for that.
----
dev.cur()
.Device
plot(0,xlim=c(0,1),ylim=c(0,1))
text(0.5,0.5,expression(bgroup('(',atop(x,y),')')))
png("bgroup_R422.png")
plot(0,xlim=c(0,1),ylim=c(0,1))
text(0.5,0.5,expression(bgroup('(',atop(x,y),')')))
dev.off()
pdf("bgroup_R422.pdf")
plot(0,xlim=c(0,1),ylim=c(0,1))
text(0.5,0.5,expression(bgroup('(',atop(x,y),')')))
dev.off()
dev.cur()
.Device
plot(0,xlim=c(0,1),ylim=c(0,1))
text(0.5,0.5,expression(bgroup('(',atop(x,y),')')))
On Tue, Dec 13, 2022 at 5:48 AM Jinsong Zhao <jszhao at yeah.net> wrote:
>
>
> On 2022/12/13 18:02, Martin Maechler wrote:
> >>>>>> Jinsong Zhao
> >>>>>> on Tue, 13 Dec 2022 17:07:00 +0800 writes:
> > > I don
> >
> > > On 2022/12/13 10:13, Derek Ogle wrote:
> > >> bgroup() from plotmath does not render properly for
> > >> me. For example
> > >>
> > >> plot(0,xlim=c(0,1),ylim=c(0,1))
> > >>
text(0.3,0.5,expression(bgroup('(',atop(x,y),')')))
> > >>
text(0.7,0.5,expression(group('(',atop(x,y),')')))
> >
> > Almost surely a Windows-only problem i.e. bug,
> > See also the bug fixed yesterday, PR#18440,
> > https://bugs.r-project.org/show_bug.cgi?id=18440
> >
> >
> I do not observe the problem in that bug report. All works fine.
>
> Best,
> Jinsong
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]