...It allows command line applications written in ObjC, C, FORTRAN, Lisp, Perl or Python to display vector graphics, text and images using a simple API. Adapters for gnuplot, PGPLOT, and PLplot exists as well.
A scientific plotting library for C/Fortran built on cairo
A 2D scientific plotting library built on cairo. Provides uniform output to pdf, ps, png and X-Windows. Written in C with no dependencies (other than cairo) as a direct replacement for PGPLOT.
Hrothgar is a parallel minimizer and Markov Chain Monte Carlo generator by Andisheh Mahdavi of San Francisco State University. It has been used to solve optimization problems in astrophysics (galaxy cluster mass profiles) as well as in experimental particle physics (hadronic tau decays). It is probably adaptable enough to be applied to your merit function if you can write it in C.