History

rewrite gnuplot_create rewrite gnuplot_create

Paul Brossier committed 20 years ago

Commit 0baafcf1 parent a7880d91 file · +14 −1Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/aubio/gnuplot.py+14−1
@@ -233,8 +233,8 @@ def plot_pitch(filename, pitch, samplerate=44100., hopsize=512, outplot=None): · 232 unmodified lines
233233 g('unset multiplot')
234234
235235 def gnuplot_init(outplot,debug=0,persist=1):
236− import Gnuplot
237236 # prepare the plot
237+ import Gnuplot
238238 g = Gnuplot.Gnuplot(debug=debug, persist=persist)
239239 if outplot == 'stdout':
240240 g("set terminal png fontfile 'p052023l.pfb'")
@@ -245,3 +245,16 @@ def gnuplot_init(outplot,debug=0,persist=1): · 4 unmodified lines
245245 g('set terminal %s' % extension)
246246 g('set output \'%s\'' % outplot)
247247 return g
248+
249+def 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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t