|
From: Tue B. <al...@gm...> - 2011-05-19 11:55:00
|
Thank you very much for the fast and helpfull reply!
The trick was to use the two in conjunction and then manually set a minus
sign on the axis with set format.
Below is the working code:
#!/usr/bin/python
from numpy import *
import Gnuplot, Gnuplot.funcutils
import os, sys, string
import glob
import struct as st
import math
import time
for datafile in glob.glob('*.txt' ):
f = open(datafile, 'r')
data = map(string.split, f.readlines())
g = Gnuplot.Gnuplot(debug=1)
g.title('Plot of generation ') # (optional)
g('set xrange[1:102]')
g('set yrange [0.01:10] reverse')
g('set format y "-%.3f"')
g('set logscale xy')
g('set terminal gif')
g('set output "'+str(datafile[:-4])+'.gif"')
g('y(r)=r0+z/r')
g('r0=0')
g('z=1')
g('fit [10:100] y(x) "'+str(datafile)+'" using 1:(-$2) via r0,z')
g('plot "'+str(datafile)+'" using 1:(-$2), y(x)')
2011/5/19 Hans-Bernhard Bröker <HBB...@t-...>
> On 19.05.2011 13:04, alyflex wrote:
>
> Hi, I got some data that I want to plot on a double logarithmic scale, but
>> since all the y values are negative, I need a negative logarithmic scale,
>> but I have thus far been unable to make one. Does anyone know how to do
>> this?
>>
>
> Negate the data on creation or on-the-fly (".. using 1:(-$2) .."), and
> revert the y axis ("set yrange reverse").
>
>
|