Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Gnuplot pdfcairo problem #11901

Closed
HanhuaInfinio opened this issue Apr 26, 2012 · 22 comments
Closed

Gnuplot pdfcairo problem #11901

HanhuaInfinio opened this issue Apr 26, 2012 · 22 comments

Comments

@HanhuaInfinio
Copy link

$ gnuplot

G N U P L O T
Version 4.6 patchlevel 0    last modified 2012-03-04 
Build System: Darwin x86_64

Copyright (C) 1986-1993, 1998, 2004, 2007-2012
Thomas Williams, Colin Kelley and many others

gnuplot home:     http://www.gnuplot.info
faq, bugs, etc:   type "help FAQ"
immediate help:   type "help"  (plot window: hit 'h')

Terminal type set to 'x11'
gnuplot> set term pdfcairo
Terminal type set to 'pdfcairo'
Options are ' transparent fontscale 0.5 size 5.00in, 3.00in '
gnuplot> set output 'test.pdf'
gnuplot> test
gnuplot> quit

The output file 'test.pdf' contains only lines and shapes but no text. Same for epscairo.

@Sharpie
Copy link
Contributor

Sharpie commented Apr 26, 2012

What is the output of your brew --config?

@HanhuaInfinio
Copy link
Author

HOMEBREW_VERSION: 0.9
HEAD: 6865d16
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 3.1 build 318
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

@Sharpie
Copy link
Contributor

Sharpie commented Apr 27, 2012

We have had similar problems with graphviz when using the Cairo library provided by Lion. Try the following:

  • Edit the gnuplot formula using brew edit gnuplot
  • Add depends_on 'cairo'
  • Re-install gnuplot

Let me know if this fixes anything.

@matteoipri
Copy link
Contributor

I have the same problem. I tried what @hanhua suggested and got the same results: no text and no margin and things messed up. I noticed the problem for the first time some days ago after upgrading pango to 1.30.0.
I wrote this gnuplot script to reproduce the issue. With the cairo terminals I cannot get any text or label in the graphs. This cause the graphs to not have margins.

set encoding utf8
set samples 10000

set term jpeg
set out 'jpegsin.jpg'
plot sin(x)
unset out

set term pdf
set out 'pdfsin.pdf'
plot sin(x)
unset out

set term png
set out 'pngsin.png'
plot sin(x)
unset out

set term pdfcairo
set out 'cairosin.pdf'
plot sin(x)
unset out

set term pngcairo
set out 'cairosin.png'
plot sin(x)
unset out

Adding depends on 'cairo'didn't help.

depends_on 'pkg-config' => :build
depends_on 'readline'
depends_on 'pango'
depends_on 'cairo'
depends_on 'pdflib-lite' if ARGV.include? "--pdf"
depends_on 'lua' unless ARGV.include? '--nolua'
depends_on 'gd' unless ARGV.include? "--nogd"

@matteoipri
Copy link
Contributor

My config:

brew --config
HOMEBREW_VERSION: 0.9
HEAD: 557387b
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit core2
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2336
Clang: 3.1 build 318
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

@fhermeni
Copy link

fhermeni commented May 2, 2012

Hi

I have the same problem here. Similar to matteoipri The addition of "depends on 'cairo'" didn't solve the problem

brew --config
HOMEBREW_VERSION: 0.9
HEAD: 144fe78
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 3.1 build 318
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

@matteoipri
Copy link
Contributor

I tried to reproduce the bug on my girlfriend's MacBook Pro but it works nice on it.

this is her brew --config
HOMEBREW_VERSION: 0.9
HEAD: feba853
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.1
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2336
Clang: 3.0 build 211
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-357
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

I feel the problem is with pango, in fact these are the versions installed on her MacBook:
pango 1.28.4 1.29.4
cairo 1.10.2
gd 2.0.36RC1
gnuplot 4.4.3 4.4.4 4.6.0

I'll try to reinstall the old pango and recompile gnuplot...

@matteoipri
Copy link
Contributor

ok, it works fine with pango 1.28.4 and with pango 1.29.4. How can we understand what the problem is with pango 1.30?

@matteoipri
Copy link
Contributor

Everything seems to work fine even with pango 1.29.5.

@matteoipri
Copy link
Contributor

Now I have a working gnuplot 4.6.0 with pango 1.29.5 compiled with clang (I removed the fails with llvm thing from the formula) and with cairo 1.12.2 compiled with clang this too. They took less time to compile!
I'm digressing... Fact is that cairo terminals of gnuplot 4.6.0 don't work with pango 1.30.0, regardless of the cairo version.
Googling, I found that this issue is reported only here.

@aeantipov
Copy link
Contributor

I have exactly the same issue - compiling with pango prior to 1.30.0 results in correct output, whereas with it there are only lines and no symbols.

@matteoipri
Copy link
Contributor

Has anyone tried this on a linux box or on mac outside of homebrew?

@adamv
Copy link
Contributor

adamv commented Jun 11, 2012

Please report this upstream to gnuplot and pdfcairo as needed.

@matteoipri
Copy link
Contributor

The problem persists with the latest pango 1.30.1 update. I'll try to figure out how to report this issue. Homebrew is my first approach to open source software.

@adamv
Copy link
Contributor

adamv commented Jul 9, 2012

MacPorts seems to disable Cairo by default.

@alexwall
Copy link

@matteoipri thank you for the hint! It works for me to.

Here the steps I've done.

brew rm cairo pango gnuplot
brew edit pango

change url and sha256 to

url 'http://ftp.gnome.org/pub/GNOME/sources/pango/1.29/pango-1.29.5.tar.xz'
sha256 '578c38de8450baa61d651e96049d2710f242bda3c47afc2d84773cbafeed775a'

save file!

brew install gnuplot --use-clang

set the terminal in your gnuplot script just to

set term pdfcairo 

to test everything works correct.

BTW: Does anyone know how to prevent brew from overwriting my edit pango-home-brew file on brew update?
Or how to prevent brew from installing new pango version on brew install outdated

@mxcl
Copy link
Contributor

mxcl commented Aug 22, 2012

BTW: Does anyone know how to prevent brew from overwriting my edit pango-home-brew file on brew update?

It's git underneath. It won't overwrite anything, it'll try to merge. You may have to deal with merge conflicts once in a while. But your changes will never be lost.

Or how to prevent brew from installing new pango version on brew install outdated

You can't stop this currently, though it won't uninstall the old version so you can just brew switch. Or just manage which packages upgrade manually. Feature in the works obv. yada yada.

@drewkett
Copy link

drewkett commented Oct 1, 2012

Just a note to anyone having this issue and can't/won't install the old pango. If you pass fontscale 20 to the term command in gnuplot, you get properly sized fonts, which would indicate that the fonts are just 20 times smaller than they should be, making them seem non-existent

@jpesce
Copy link

jpesce commented Oct 4, 2012

Installing pdflib-lite before gnuplot helped for me:
brew install pdflib-lite
brew uninstall gnuplot
brew install gnuplot

@adamv
Copy link
Contributor

adamv commented Oct 4, 2012

Do we need to add this as a dep?

@adamv
Copy link
Contributor

adamv commented Oct 15, 2012

Try brew install -v gnuplot --pd to add the PDF renderer, there is an option for this.

@matteoipri
Copy link
Contributor

they are 2 different terminals, and the cairo based one is way much better in my opinion.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants