LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2023, 10:21 PM   #1
gregors
Member
 
Registered: Mar 2018
Posts: 177

Rep: Reputation: Disabled
Question How to use utf-8 in gnuplot?


[ This Thread is "semi solved". See last post. ]

Hi there!

I'm using gnuplot to make me some nice diagrams of log files (e.g. containing cpu load/temperature values from "uptime" and "sensors").
Now I would like to use the character "greater-than" ( in HTML > ) in text.

How can I achieve this?

TIA

Gregor

Last edited by gregors; 01-17-2023 at 06:43 PM.
 
Old 01-11-2023, 02:42 AM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
You should be able to just type it…you may need to escape it or quote it.
Where do you want to use it? In a label?
 
Old 01-11-2023, 02:48 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
yes, you just need to type (or enter) it. Do you have any difficulties?
 
Old 01-11-2023, 10:24 AM   #4
gregors
Member
 
Registered: Mar 2018
Posts: 177

Original Poster
Rep: Reputation: Disabled
Thanks for your answers!

See https://test.szaktilla.de/plotshot.png

Everything's fine with the degree char, but the "greater or equal" in the headline isn't printed.

Why? How can I fix this?

Gregor
 
Old 01-11-2023, 05:45 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,732

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Hmmm…that’s not a > Did you try escaping it?
If the chart is going to be rendered on a web page you could try ≥
If > works, you could say “> 5 Stunden” or “>= 6 Stunden”

Last edited by scasey; 01-11-2023 at 06:04 PM.
 
Old 01-11-2023, 06:51 PM   #6
gregors
Member
 
Registered: Mar 2018
Posts: 177

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Hmmm…that’s not a > Did you try escaping it?
If the chart is going to be rendered on a web page you could try ≥
If > works, you could say “> 5 Stunden” or “>= 6 Stunden”
I'm sorry, that was some kind of typo (haven't used HTML actively for about 15 years). I actually mean ≥

Well, yes, I was thinking about working around my problem by first using a plain ">" but now by writing "mind.".

So, I'm still looking for information on how to put an ≥ there - or, generally speaking, on how to put any utf-8 char in an gnuplot label.

Gregor

Last edited by gregors; 01-11-2023 at 06:55 PM.
 
Old 01-11-2023, 07:20 PM   #7
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
Within a double quoted string, you can use UTF-8 escapes like this: \\U+2265
which will produce a greater than or equal to character. The form is \U+HHHH where
HHHH is the hex Unicode value, but the backslash has to be doubled when used
inside double quotes. This is useful if you can't (or don't want to) actually
type the UTF-8 character in your text editor like this: ≥
 
Old 01-11-2023, 09:07 PM   #8
gregors
Member
 
Registered: Mar 2018
Posts: 177

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ljb643 View Post
Within a double quoted string, you can use UTF-8 escapes like this: \\U+2265
which will produce a greater than or equal to character. The form is \U+HHHH where
HHHH is the hex Unicode value, but the backslash has to be doubled when used
inside double quotes. This is useful if you can't (or don't want to) actually
type the UTF-8 character in your text editor like this: ≥
Unfortunately this doesn't work. So I played around with fonts and characters.
And made another screenshot:
https://test.szaktilla.de/plotshot2.png
As you can see, the Pi character is printed, all others are not.

I'm pretty stumped ...

Gregor
 
Old 01-12-2023, 01:35 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
this looks like a locale (language) specific settings (but I can only guess).
Let's say emacs is running with a different locale, and it displays properly everything, but the saved file contains non utf-8 chars.
 
Old 01-12-2023, 04:06 PM   #10
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
Could be a locale problem, but also possibly the font you are using (Bitstream Charter?) simply does not have the characters you want. It looks like it did a few correctly: the degree symbol, and the 'pillcrow' or paragraph symbol. If it does some but not all non-ASCII characters you want, that makes me suspect the font is missing the others. I think you need to find a PostScript font that has a wider Unicode coverage, or change to a different gnuplot driver that uses different fonts.
 
Old 01-12-2023, 04:46 PM   #11
gregors
Member
 
Registered: Mar 2018
Posts: 177

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ljb643 View Post
Could be a locale problem, but also possibly the font you are using (Bitstream Charter?) simply does not have the characters you want. It looks like it did a few correctly: the degree symbol, and the 'pillcrow' or paragraph symbol. If it does some but not all non-ASCII characters you want, that makes me suspect the font is missing the others. I think you need to find a PostScript font that has a wider Unicode coverage, or change to a different gnuplot driver that uses different fonts.
Meanwhile I suspect that to be some problem outside of gnuplot, too. To make sure it doesn't have anything to do with missing glyphs in the font I changed it to „Liberation Serif“. In Libre Office there's no problem with any „special characters“.


Gregor

PS: Updated shot here: https://test.szaktilla.de/plotshot3.png

Last edited by gregors; 01-12-2023 at 04:52 PM.
 
Old 01-17-2023, 06:46 PM   #12
gregors
Member
 
Registered: Mar 2018
Posts: 177

Original Poster
Rep: Reputation: Disabled
Hi again,

so since I didn't find out how to print the character I want, I used a work around and played a bit with fonts. Just in case you're interested in the final result, see https://gregor.szaktilla.de/web/plot.pdf

Gregor
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] making a gnuplot 3d graph or gnuplot fence plot Rinndalir Programming 3 10-23-2015 01:10 PM
[SOLVED] gnuplot basic graph problem - noob to gnuplot sudowtf Linux - General 2 04-02-2015 11:00 AM
How do I know how a file is encoded? UTF-8, UTF-16, etc.. ?? brynjarh Linux - General 1 12-03-2004 11:11 AM
[Enter] in text documents diffrent on Windows and Linux? UTF-8/UTF-16 problem or? brynjarh Linux - General 1 11-24-2004 05:20 AM
X11 / UTF-8 locale seems missing 'fr_FR.UTF-8' chrsitophermann Debian 11 07-17-2004 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration