# $CVSHeader: pal8e/src/DSSPPlot.py,v 1.2 2005/02/15 01:10:25 indraneel Rel $

import Gnuplot
import Numeric

class DSSPPlot:
    def __plot(self, g, data, cols, titles):
        p=len(cols)
        d=range(p)
        for i,c in enumerate(cols):
            d[i] = Gnuplot.Data(data, cols=c, title=titles[i])
        g.plot(*d)

    def plot(self, data, cols, titles, t, xl, yl, fname):
        g = Gnuplot.Gnuplot()
        g('set data style lines')
        g.title(t)
        g.xlabel(xl)
        g.ylabel(yl)
        self.__plot(g, data, cols, titles)
        g.hardcopy(fname, eps=1, enhanced=1, color=1)
