[Thread Prev][Thread Next][Index]

Re: [EXTERNAL] Re: [ferret_users] how to show angle brackets in labels/titles



Dear Ryo and Ansley,

emdash works for some fonts like Times. For fonts like Helvatica, the symbol became a mirror symmetric "C" for emdash. 😸 So the emdash trick works for some fonts. 

The Math font methods have some problems. If I do 

label 180,0,0,0,0.2,@IM22@MA26 Text @MA27

Pyferret doesn't recognize Text is not a math symbol so the label came out as —<....>. Is there a command like @Text, so Ferret can recognize the text?

Thank you very much and stay healthy,

Xiaoyu

On Fri, Jan 28, 2022 at 1:50 AM Ryo Furue <furue@xxxxxxxxxx> wrote:
Dear Xiaoyu,

By the way, are there some tricks to "draw" a longer line in a label but without really plotting the line?

Say I use 

label 0 -12 0 0 .2 - -<OLR>

to label a line (-) using a negative OLR -<OLR>. They both come out as the same length. I am currently using 

label 0 -12 0 0 .2 _ -<OLR> to distinguish these two lines.

Let me know if there are better tricks.

Actually, you can use any unicode characters with system fonts.  I'm attaching a ferret script to demonstrate how you use them.

You probably want to use some of these:

endash: –
emdash: —
minus: −
hyphen: -

For a longer dash, you can repeat endash or emdash:

2 endashes: ––
2 emdashes: ——
2 minuses: −−
2 hyphens: --

Unfortunately, how these characters look on your plot depends on the font you use.  In particular, some of the repeated dashes may or may not be connected.  You may need to test various fonts.

In unicode, there are other dashes that are guaranteed to be connected:

https://en.wikipedia.org/wiki/Box-drawing_character#Box_Drawing

Regards,

Ryo

!--- "dashes" demonstration ----
set data coads_climatology
set text/font=Helvetica
fill/L=1 SST
label 180,0,0,0,0.2,"endash–; emdash—; minus−; hyphen-"
label 180,-30,0,0,0.2,"endash––; emdash——; minus−−; hyphen--"
set text/font=Times
fill/L=1 SST
label 180,0,0,0,0.2,"endash–; emdash—; minus−; hyphen-"
label 180,-30,0,0,0.2,"endash––; emdash——; minus−−; hyphen--"
 


--
Xiaoyu (she/her)

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement