最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Overlapping Gnuplot ylabel letters in jpeg, gif, and png terminals - Stack Overflow

programmeradmin3浏览0评论

I am getting odd output when I make a graph and output it to a jpeg. The letters for the ylabel are all overlapping in a single space.

A minimal example is

set xlabel "THIS"
set ylabel "THAT"
f(x) = sin(x)
set terminal jpeg
set output "minimal-example.jpeg"
plot f(x)

This results in:Please note ylabel.

I am using gnuplot 6.0 under Ubuntu 24.10.

The ylabel looks fine in the default "to screen" output, and looks fine if I set the terminal to pdf. It persists with gif, jpeg, and png.

I am getting odd output when I make a graph and output it to a jpeg. The letters for the ylabel are all overlapping in a single space.

A minimal example is

set xlabel "THIS"
set ylabel "THAT"
f(x) = sin(x)
set terminal jpeg
set output "minimal-example.jpeg"
plot f(x)

This results in:Please note ylabel.

I am using gnuplot 6.0 under Ubuntu 24.10.

The ylabel looks fine in the default "to screen" output, and looks fine if I set the terminal to pdf. It persists with gif, jpeg, and png.

Share edited Mar 7 at 14:55 isherwood 61.2k16 gold badges121 silver badges170 bronze badges asked Mar 7 at 14:53 Edward BrothersEdward Brothers 11 bronze badge 2
  • Please don't tag your titles. See How to Ask and take the tour. – isherwood Commented Mar 7 at 14:56
  • I have seen something similar here with earlier gnuplot versions, however, unfortunately can't find the post anymore. But I cannot reproduce this for any of gif, jpg, png on 6.0.0 and 6.0.2 on Windows 10. So, maybe something Linux specific with the graphics libraries? – theozh Commented Mar 7 at 15:26
Add a comment  | 

1 Answer 1

Reset to default 0

This is not a gnuplot error per se. It is a font-handling problem in the pango and harfbuzz system libraries due to major changes in how different types of fonts are rendered. The changes were made over several years in multiple versions of these libraries. I don't have a good solution other than trying to upgrade or downgrade all the libraries to a compatible set of versions. More information via the links below.

https://github/harfbuzz/harfbuzz/issues/2394#issuecomment-626254448
Overlapping letters in tics and labels gnuplot 5.4
Gnuplot PDF Terminal Exhibits Font Issues on Mac

发布评论

评论列表(0)

  1. 暂无评论