Trying to use gnuplot in massif_grapher

I’ve been trying to use gnuplot instead of Gd::Chart in my massif_grapher script, mostly just so it can generate zoomable postscript or SVG output.

I first tried using the Chart::Gnuplot perl API, but after a very helpful email conversation with its maintainer Ka-Wai Mak, we found that it cannot yet be used to create gnuplot’s “rowstacked” histograms. So now my gnuplot branch of massif_brancher uses gnuplot directly. However, there are still some problems that I can’t solve easily:

  • The x axis has a label for each item, which makes it cluttered, with overlapping text. I think this cannot be changed while using xtics(1) in the “using” statement, but that’s voodoo to me and I can’t find some version of the using statement that doesn’t use xtics.
  • When using massif_grapher’s –detailed option, for instance with the example .out file, there are 60 stacked columns of data. The legend (key) is then so big that it pushes the graph off the page. I’ve asked about this on the gnuplot mailing list, but I am inpatient.

Actually, I wish I could do these stacked (or “cumulative” in Gd::Chart terms) graphs for regular line graphs, instead of just as items on a histogram, in case the snapshot times are not at regular intervals.

7 thoughts on “Trying to use gnuplot in massif_grapher

  1. If there’s any chance that you could use python instead of perl, I’d highly recommend matplotlib.

  2. benni, yeah, I’ve heard that before, and have already bookmarked it for later reading, but I’d rather not bounce around too much between APIs without really checking that I can’t just fix my bugs. I have no love for perl, but it did let me reuse some existing parsing code.

  3. btmore,
    set xtics 1000
    should specify that there should be tics on the x axis at every multiple of 1000, right?
    No, that doesn’t seem to work. I think the xtic(1) in the using statement overrides it.

    You can see this easily by checking out that branch from git and trying
    ./massif_grapher.pl example_massif.out
    The result is then in massif_pretty.ps

  4. xtic(1) tells to put the string in column 1 at the same x than that value, so yes they will all be there
    As a ugly hack, maybe you can have only put a non empty time in the data set for 1 line every (total number of lines/20)

    I could not however find how to have empty label, here is something with “-” which improves the situation :

    print TABLE $i % int($n_snapshots/20) ? “-” : $times[$i];

  5. Oh and it seems I forgot something in my previous comment, giving a stpe to xtics does not help in this case as the values are strings

Comments are closed.