[R] Can I increase the size of an asterisk in plotmath()?

31 views
Skip to first unread message

Rolf Turner

unread,
Jun 29, 2016, 8:40:52 PM6/29/16
to r-h...@r-project.org

I am trying to plot an expression of the form "p^*" --- a bold letter p
with the asterisk as a superscript.

I can get *something* with code of the form

plot(1:10)
text(7.5,2.5,expression(paste(bolditalic(p)^"*")))

but the asterisk that appears is *tiny*.

Is there any way to increase its size? (I expect not, but I just
thought I'd ask!)

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

______________________________________________
R-h...@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.

Göran Broström

unread,
Jun 30, 2016, 3:39:54 AM6/30/16
to r-h...@r-project.org
Rolf,

text(7.5,2.5,expression(paste(bolditalic(p),"*", sep = "")))

looks quite nice. On my Mac at least.

Göran

On 30/06/16 02:38, Rolf Turner wrote:
>
> I am trying to plot an expression of the form "p^*" --- a bold letter p
> with the asterisk as a superscript.
>
> I can get *something* with code of the form
>
> plot(1:10)
> text(7.5,2.5,expression(paste(bolditalic(p)^"*")))
>
> but the asterisk that appears is *tiny*.
>
> Is there any way to increase its size? (I expect not, but I just
> thought I'd ask!)
>
> cheers,
>
> Rolf Turner
>

Rolf Turner

unread,
Jun 30, 2016, 4:48:28 AM6/30/16
to Göran Broström, r-h...@r-project.org
On 30/06/16 19:38, Göran Broström wrote:
> Rolf,
>
> text(7.5,2.5,expression(paste(bolditalic(p),"*", sep = "")))
>
> looks quite nice. On my Mac at least.

<SNIP>

Well, it didn't look nice on my laptop. The asterisk was nearly invisible.

cheers,

Rolf

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

Sarah Goslee

unread,
Jun 30, 2016, 9:29:54 AM6/30/16
to Rolf Turner, r-help
I don't know of an automatic way, but of course you can make it as
large as you'd like.


plot(1:10, type="n")
text(2, 8, expression(paste(bolditalic(p)^"*"))) #Rolf's original
text(2, 6,expression(paste(bolditalic(p),"*", sep = ""))) #Goran's suggestion


text(2, 3, expression(paste(bolditalic(p)^"*"))) # repeat Rolf's original
text(locator(1), "*", cex=3) # click on the asterisk: how big do you want it?

Sarah

On Thu, Jun 30, 2016 at 4:46 AM, Rolf Turner <r.tu...@auckland.ac.nz> wrote:
> On 30/06/16 19:38, Göran Broström wrote:
>>
>> Rolf,
>>
>> text(7.5,2.5,expression(paste(bolditalic(p),"*", sep = "")))
>>
>> looks quite nice. On my Mac at least.
>
>
> <SNIP>
>
> Well, it didn't look nice on my laptop. The asterisk was nearly invisible.
>
> cheers,
>
> Rolf
>

______________________________________________

Paul Murrell

unread,
Jun 30, 2016, 6:53:05 PM6/30/16
to Sarah Goslee, Rolf Turner, r-help
Hi

There are a couple of plotmath expressions that control text size, plus
in this case you could just drop the superscripting (which I believe was
Goran's advice) ...

plot(1:10, type="n")
text(2, 8, expression(paste(bolditalic(p)^"*"))) #Rolf's original

text(2, 6, expression(paste(bolditalic(p)^textstyle("*"))))
text(2, 4, expression(paste(bolditalic(p)*"*")))

Paul

--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
pa...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

Rolf Turner

unread,
Jun 30, 2016, 10:52:43 PM6/30/16
to Sarah Goslee, r-h...@r-project.org
On 01/07/16 01:28, Sarah Goslee wrote:
> I don't know of an automatic way, but of course you can make it as
> large as you'd like.
>
>
> plot(1:10, type="n")
> text(2, 8, expression(paste(bolditalic(p)^"*"))) #Rolf's original
> text(2, 6,expression(paste(bolditalic(p),"*", sep = ""))) #Goran's suggestion
>
>
> text(2, 3, expression(paste(bolditalic(p)^"*"))) # repeat Rolf's original
> text(locator(1), "*", cex=3) # click on the asterisk: how big do you want it?

That's certainly a possibility, but it requires interactive use, which I
would like to avoid. Ideally I would like a solution that is completely
"code-able".

Thanks.

cheers,

Rolf


--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

Rolf Turner

unread,
Jul 1, 2016, 12:04:19 AM7/1/16
to Paul Murrell, r-help
On 01/07/16 10:51, Paul Murrell wrote:
> Hi
>
> There are a couple of plotmath expressions that control text size, plus
> in this case you could just drop the superscripting (which I believe was
> Goran's advice) ...
>
> plot(1:10, type="n")
> text(2, 8, expression(paste(bolditalic(p)^"*"))) #Rolf's original
> text(2, 6, expression(paste(bolditalic(p)^textstyle("*"))))
> text(2, 4, expression(paste(bolditalic(p)*"*")))

Thanks Paul.

cheers,

Rolf

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

Rolf Turner

unread,
Jul 1, 2016, 1:04:53 AM7/1/16
to Jim Lemon, r-h...@r-project.org
On 01/07/16 15:29, Jim Lemon wrote:
> Hi Rolf,
> A bit of poking around reveals that different fonts have different
> size asterisks. If you are not already using Times Roman, it might be
> worth a look. I only have Windows on this (work) PC, so I can't check
> the Postscript fonts.

Thanks Jim.

Jim Lemon

unread,
Jul 1, 2016, 1:05:47 AM7/1/16
to Rolf Turner, r-h...@r-project.org
Hi Rolf,
A bit of poking around reveals that different fonts have different
size asterisks. If you are not already using Times Roman, it might be
worth a look. I only have Windows on this (work) PC, so I can't check
the Postscript fonts.

Jim
Reply all
Reply to author
Forward
0 new messages