|
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
|
|
From: Hans-Bernhard B. <HBB...@t-...> - 2008-10-01 19:24:57
|
Florian Koelling wrote: > 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. Then you'll have to check the documentation of gnuplot.py about interactive vs. direct-to-file outputs. Suffice it to say that "hardcopy" probably shouldn't be a command you use: > g.plot(d) > g.hardcopy(place_2_save_4_feat, terminal='png') This plots the data to the screen first, then outputs it to a file. That's not what you want, so don't do that. |
|
From: Florian K. <flo...@tu...> - 2008-10-02 08:31:41
|
Hans-Bernhard Bröker wrote: > Florian Koelling wrote: > >> 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. > > Then you'll have to check the documentation of gnuplot.py about > interactive vs. direct-to-file outputs. Suffice it to say that > "hardcopy" probably shouldn't be a command you use: > >> g.plot(d) >> g.hardcopy(place_2_save_4_feat, terminal='png') > > This plots the data to the screen first, then outputs it to a file. > That's not what you want, so don't do that. Hi I haven't found a documentation touching this topic and I have to use the "plot" command. Without doing so I only receive empty Documents. Tanks! |
|
From: I W. W. <wa...@ya...> - 2008-10-02 08:46:35
|
Do you mean your plot is displayed in the screen? If so, you may change the terminal, i.e., png or other graphic formats. I prefer to use postscript or pdf terminal. PNG or other bitmapped graphics are to bad for producing a reports. You just put a simple command, i.e., set terminal postscript set output "name_of_output.ps" plot .... Gruess, Wayan --- Florian Koelling <flo...@tu...> wrote: > Hans-Bernhard Bröker wrote: > > Florian Koelling wrote: > > > >> 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. > > > > Then you'll have to check the documentation of > gnuplot.py about > > interactive vs. direct-to-file outputs. Suffice > it to say that > > "hardcopy" probably shouldn't be a command you > use: > > > >> g.plot(d) > >> g.hardcopy(place_2_save_4_feat, > terminal='png') > > > > This plots the data to the screen first, then > outputs it to a file. > > That's not what you want, so don't do that. > > Hi I haven't found a documentation touching this > topic and I have to use > the "plot" command. Without doing so I only receive > empty Documents. > > Tanks! > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your > Move Developer's challenge > Build the coolest Linux based applications with > Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source > event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Gnuplot-info mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |
|
From: Florian K. <flo...@tu...> - 2008-10-02 10:30:59
|
Hi!
With popping up I mean the plot appearing on the screen and then
immediately to be closed --> so you can see the plots flashing on
the screen - I tried
g.plot(d)
g.hardcopy(place_2_save_4_feat)
with ps it seems to work better - but it still fails sometimes - what
can I chose for other output formats which may increase my performance?
Thanks!
Florian
I Wayan Warmada wrote:
> Do you mean your plot is displayed in the screen?
> If so, you may change the terminal, i.e., png or other
> graphic formats. I prefer to use postscript or pdf
> terminal. PNG or other bitmapped graphics are to bad
> for producing a reports.
>
> You just put a simple command, i.e.,
>
> set terminal postscript
> set output "name_of_output.ps"
>
> plot ....
>
> Gruess,
> Wayan
>
> --- Florian Koelling <flo...@tu...>
> wrote:
>
>
>> Hans-Bernhard Bröker wrote:
>>
>>> Florian Koelling wrote:
>>>
>>>
>>>> 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.
>>>>
>>> Then you'll have to check the documentation of
>>>
>> gnuplot.py about
>>
>>> interactive vs. direct-to-file outputs. Suffice
>>>
>> it to say that
>>
>>> "hardcopy" probably shouldn't be a command you
>>>
>> use:
>>
>>>> g.plot(d)
>>>> g.hardcopy(place_2_save_4_feat,
>>>>
>> terminal='png')
>>
>>> This plots the data to the screen first, then
>>>
>> outputs it to a file.
>>
>>> That's not what you want, so don't do that.
>>>
>> Hi I haven't found a documentation touching this
>> topic and I have to use
>> the "plot" command. Without doing so I only receive
>> empty Documents.
>>
>> Tanks!
>>
>>
>>
>>
>>
> -------------------------------------------------------------------------
>
>> This SF.Net email is sponsored by the Moblin Your
>> Move Developer's challenge
>> Build the coolest Linux based applications with
>> Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source
>> event anywhere in the world
>>
>>
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>
>> _______________________________________________
>> Gnuplot-info mailing list
>> Gnu...@li...
>>
>>
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
>
>
>
>
|