Changeset 0baafcf for python


Ignore:
Timestamp:
Feb 23, 2006, 3:12:28 AM (19 years ago)
Author:
Paul Brossier <piem@altern.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
37f0352
Parents:
a7880d9
Message:

rewrite gnuplot_create
rewrite gnuplot_create

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/gnuplot.py

    ra7880d9 r0baafcf  
    234234
    235235def gnuplot_init(outplot,debug=0,persist=1):
     236        # prepare the plot
    236237        import Gnuplot
    237         # prepare the plot
    238238        g = Gnuplot.Gnuplot(debug=debug, persist=persist)
    239239        if outplot == 'stdout':
     
    246246                g('set output \'%s\'' % outplot)
    247247        return g
     248
     249def gnuplot_create(outplot='',extension='',debug=0,persist=1):
     250        import Gnuplot
     251        g = Gnuplot.Gnuplot(debug=debug, persist=persist)
     252        if not extension or not outplot: return g
     253        if   extension == 'ps':  ext, extension = '.ps' , 'postscript'
     254        elif extension == 'png': ext, extension = '.png', 'png'
     255        elif extension == 'svg': ext, extension = '.svg', 'svg'
     256        else: exit("ERR: unknown plot extension")
     257        g('set terminal %s' % extension)
     258        if outplot != "stdout":
     259                g('set output \'roc-%s%s\'' % (outplot,ext))
     260        return g
Note: See TracChangeset for help on using the changeset viewer.