I love the cairo terminal in gnuplot, it creates amazing plots. My recent upgrade to Mountain Lion broke my homebrew based gnuplot installation, throwing a bunch of glib errors when I set the terminal to pdfcairo or pngcairo (normal terminals work fine):

    Error: GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init() 

This is essentially an issue with the latest version of Pango package. There are two ways to fix this:

  • Force homebrew to go back to a lower version of Pango; this error seems to appear in versions 1.32.6 or later.
  • Patch the gnuplot installation’s Cairo terminal as suggested here.

Note: If you are not getting cairo terminals in your gnuplot installation, reinstall it with cairo option enabled: brew install gnuplot --cairo