Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

Save yourself! Reboot in 5 seconds!


computers / comp.graphics.apps.gnuplot / Escaping special characters into titles/axis labels

SubjectAuthor
* Escaping special characters into titles/axis labelsMartin Brown
`* Re: Escaping special characters into titles/axis labelsKarl Ratzsch
 `- Re: Escaping special characters into titles/axis labelsMartin Brown

1
Subject: Escaping special characters into titles/axis labels
From: Martin Brown
Newsgroups: comp.graphics.apps.gnuplot
Organization: Aioe.org NNTP Server
Date: Fri, 19 Mar 2021 16:13 UTC
Path: i2pn2.org!i2pn.org!aioe.org!+8mPIB5KbEwMk3TfLZpgnQ.user.gioia.aioe.org.POSTED!not-for-mail
From: '''newsp...@nonad.co.uk (Martin Brown)
Newsgroups: comp.graphics.apps.gnuplot
Subject: Escaping special characters into titles/axis labels
Date: Fri, 19 Mar 2021 16:13:07 +0000
Organization: Aioe.org NNTP Server
Lines: 29
Message-ID: <s32iii$32f$1@gioia.aioe.org>
NNTP-Posting-Host: +8mPIB5KbEwMk3TfLZpgnQ.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
X-Mozilla-News-Host: news://nntp.aoie.org:119
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
View all headers
I'm new to gnuplot and find it very powerful but there are a couple of fairly simple things that I just can't see how to do.

One is to escape in the greek symbol "alpha", "beta","theta" or "pi" or equivalently to tell the axis scaling logic that I would like an axis to scaled in fractions of pi. I can rename the variables but pi is well pi!

The compromise I have settled on for now is to plot the results on the range -1 to 1 and label the axis as theta/pi since I don't know and can't figure out how to escape it in. I tried \pi a la TeX.

I have also tried various suggestions I found online {/Symbol p} and I do get an unprintable character displayed as a "?" but nothing more terminal type is "qt" enhanced.

Thanks for any enlightenment on how to show Greek letters on graphs.

I was initially confused by the distinction when in mono mode between set mono linetype and set linetype. It all worked OK once I remembered to explicitly specify set mono linetype.

A few more distinct defined mono linetypes wouldn't go amiss in the default distribution. 5 seems a bit mean given that they are a bit tricky to alter. Seems to me when terminal is in mono mode the "mono" linetype settings should be the ones that get changed by set linetype.

--
Regards,
Martin Brown


Subject: Re: Escaping special characters into titles/axis labels
From: Karl Ratzsch
Newsgroups: comp.graphics.apps.gnuplot
Date: Fri, 19 Mar 2021 19:59 UTC
References: 1
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: mail....@gmx.net (Karl Ratzsch)
Newsgroups: comp.graphics.apps.gnuplot
Subject: Re: Escaping special characters into titles/axis labels
Date: Fri, 19 Mar 2021 20:59:31 +0100
Message-ID: <s32vr2$s8e$1@solani.org>
References: <s32iii$32f$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 19 Mar 2021 19:59:30 -0000 (UTC)
Injection-Info: solani.org;
logging-data="28942"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
Cancel-Lock: sha1:s88z1iWPCiOY5P4YAz2aBvLWI2Y=
In-Reply-To: <s32iii$32f$1@gioia.aioe.org>
Content-Language: de-DE
X-User-ID: eJwNyMERwDAIA7CVCNhmnuAL+4/Q6imWjtwQBS43OI4k32IbtJbR422OdFlZ+T/aOPATPxYDEKU=
View all headers
Am 19.03.2021 um 17:13 schrieb Martin Brown:
I'm new to gnuplot and find it very powerful but there are a couple of fairly simple things that I just can't see how to do.

One is to escape in the greek symbol 'alpha', 'beta','theta' or 'pi' or equivalently to tell the axis scaling logic that I would like an axis to scaled in fractions of pi. I can rename the variables but pi is well pi!


The most straightforward method is to set all tics explicitly

set xtics pi ('pi/2' pi/2, 'pi' pi, '3pi/2' 3*pi/2, \
      '2pi' 2*pi, '5pi/2' 5*pi/2, '3pi' 3*pi)
set grid
plot [0:3*pi] sin(x)

, you might use a "do for" loop to create the tics/labels as a macro string. Alternatively you can just scale everything

set xtics .5 format '%hpi'
set grid
plot [0:3] sin(x*pi) title 'sin(x)'

.. It could be nice to be able to add a piece of math containing the axis variable to the format string, like with gprintf(). You can post a feature request on gnuplot.sf.net

Use utf8 encoding ("set encoding utf8") to put in the pi symbol (copy the greek symbols from a web page), or use one of the latex terminals.

Hth!
     Karl


Subject: Re: Escaping special characters into titles/axis labels
From: Martin Brown
Newsgroups: comp.graphics.apps.gnuplot
Organization: Aioe.org NNTP Server
Date: Sun, 21 Mar 2021 09:32 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!aioe.org!+8mPIB5KbEwMk3TfLZpgnQ.user.gioia.aioe.org.POSTED!not-for-mail
From: '''newsp...@nonad.co.uk (Martin Brown)
Newsgroups: comp.graphics.apps.gnuplot
Subject: Re: Escaping special characters into titles/axis labels
Date: Sun, 21 Mar 2021 09:32:37 +0000
Organization: Aioe.org NNTP Server
Lines: 37
Message-ID: <s373rl$7nt$2@gioia.aioe.org>
References: <s32iii$32f$1@gioia.aioe.org> <s32vr2$s8e$1@solani.org>
NNTP-Posting-Host: +8mPIB5KbEwMk3TfLZpgnQ.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
View all headers
On 19/03/2021 19:59, Karl Ratzsch wrote:
Am 19.03.2021 um 17:13 schrieb Martin Brown:
I'm new to gnuplot and find it very powerful but there are a couple of fairly simple things that I just can't see how to do.

One is to escape in the greek symbol 'alpha', 'beta','theta' or 'pi' or equivalently to tell the axis scaling logic that I would like an axis to scaled in fractions of pi. I can rename the variables but pi is well pi!


The most straightforward method is to set all tics explicitly

     set xtics pi ('pi/2' pi/2, 'pi' pi, '3pi/2' 3*pi/2, \
               '2pi' 2*pi, '5pi/2' 5*pi/2, '3pi' 3*pi)
     set grid
     plot [0:3*pi] sin(x)

, you might use a "do for" loop to create the tics/labels as a macro string. Alternatively you can just scale everything

     set xtics .5 format '%hpi'
     set grid
     plot [0:3] sin(x*pi) title 'sin(x)'

. It could be nice to be able to add a piece of math containing the axis variable to the format string, like with gprintf(). You can post a feature request on gnuplot.sf.net

Use utf8 encoding ("set encoding utf8") to put in the pi symbol (copy the greek symbols from a web page), or use one of the latex terminals.

Thank you for your very helpful explanation of how to do it.

--
Regards,
Martin Brown


1
rocksolid light 0.7.2
clearneti2ptor