0
votes

If the Unicode codepoint for a full moon is U+1F315, how do I use that in a plot?

Using @andyras example:

set terminal epslatex standalone color
set output 'plot.tex'
set xlabel '$\odot$ is a \LaTeX symbol.'
plot sin(x)

(here on SO gnuplot - pdf terminal - setting unicode character (solar mass symbol/odot))

How would I insert that Unicode character? Preferred output is PDF and I have pdfcairo installed.

UPDATE: @darthbith @Christoph

Turns out the Symbola font includes all unicode glyphs for basic moon phases. In these labels, the last 2 work. Inserted as symbols into the BBedit command file, the symbols appear correctly; BBedit file is saved as UTF8; UTF8 is set in the terminal. The SVG terminal output displays all the characters properly; the Aqua abd PDF terminals display only the First and Last Quarters properly:

"" u (myDateSP(1,2)):3:((strcol(4) eq "New") ?  ("????"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "Full") ?  ("????"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("☽"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "Last") ?  ("☾"):1/0) w labels left font "Symbola,28" offset -4,0,\

Neither of these terminal setups seems to help:

set terminal pdfcairo enhanced size 13.5,9.8 set term pdfcairo enhanced font "Symbola" size 13.5,9.8

1
Do you know how to use LaTeX? If so, this says that the symbol is \fullmoon instead of \odot.darthbith
If you use the pdfcairo terminal, use an unicode string, like Lee Phillips' answer to the question you linked says. Then you also need a font which supports the full moon symbol (for me, the default font doesn't have that glyph).Christoph
@ darthbith @ Christoph Solved over in the comp.graphics.apps.gnuplot group, in this thread: <groups.google.com/forum/#!topic/comp.graphics.apps.gnuplot/…> The explanation is too long to put in here.Dan
@Dan You can answer your own question (I believe enough time has passed to allow that.) This will help anyone who comes upon this answer in Google.darthbith

1 Answers

0
votes

Turns out the Symbola font includes all unicode glyphs for basic moon phases. In these labels, the last 2 work. Inserted as symbols into the BBedit command file, the symbols appear correctly; BBedit file is saved as UTF8; UTF8 is set in the terminal. The SVG terminal output displays all the characters properly; the Aqua and PDF terminals display only the First and Last Quarters properly.

The solution was to use the Symbola font and glyphs, and substitute its circle and large black circle for the full and new moon. The full/new moon codepoints are such recent additions that they rarely work in desktop applications (they do work in BBEdit, but not in PDFcairo terminal).

The thread with full details about all this is here:

https://groups.google.com/forum/#!topic/comp.graphics.apps.gnuplot/96gDfBo3gp8

And my labels now look like this and worked as I wwanted.

"" u (myDateSP(1,2)):3:((strcol(4) eq "New") ?  ("●"):1/0) w labels left font "Symbola,68" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "Full") ?  ("◯"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("☽"):1/0) w labels left font "Symbola,40" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "Last") ?  ("☾"):1/0) w labels left font "Symbola,40" offset -4,0,\