|
From: Florian K. <flo...@tu...> - 2008-10-01 16:57:38
|
Hi folks!
I'm interfacing gnuplot through a python program : I' m Calculating
distances and plot them via Gnuplot --- for a great Data amount .
While plotting the Data, Gnuplot suddenly interrupts plotting (and
executing my program) -- with an open shell or a left plot on the
screen -- although I close every plot after plotting.
Is there any possibility to avoid the plot-open plot-close plot
procedure? I only would like to save my Data to Disk without having any
popup.
my code:
max_y = 1.0 #Energy between 0 and 100 %
min_y = 0.0
counter = 0
for feat_list in clustered_feat_spots:
### Settings 4 one probe cluster
name_for_saving =
output_name+str(counter)+"_for_every_probe"+".png"
place_2_save_4_feat =
path_2_write_curves_4_every_feat+name_for_saving
#### Range 4 plot
counter = counter +1
nr_spots= len(feat_list)
min_x = 0
max_x = (nr_spots)+1 ##adding 2 because i for i does not count
last one!
x_string = 'set xrange'+'['+str(min_x)+':'+str(max_x)+']'
y_string = 'set yrange'+'['+str(min_y)+':'+str(max_y)+']'
###Data 4 plotting
x_val_pre =[i for i in range (max_x)]
x_val = x_val_pre[1:]
y_val = feat_list
###Plot Details
g = Gnuplot.Gnuplot(persist=1)
g.title(name_for_saving)
g('set data style linespoints')
g('set pointsize 2')
g('set grid')
g.xlabel("spots in tolerance radius")
g.ylabel("rel. Energy")
g(x_string)
g(y_string)
##d = Gnuplot.Data(x,y,title='squared', with='lp lt 1 pt 7')
Example for different colors!
d = Gnuplot.Data(x_val,y_val, with=color_plot)
g.plot(d)
g.hardcopy(place_2_save_4_feat, terminal='png')
g.reset()
Thanks alot!
Florian
|