|
From: alyflex <al...@gm...> - 2011-05-19 11:05:00
|
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?
The python script I'm using is the following:
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' ):
g.title('Plot')
g('set xrange[0.1:100]')
g('set yrange[-10:-1]')
g('set terminal gif')
g('set logscale xy')
g('set output "'+str(datafile[:-4])+'.gif"')
g('y(r)=r0+z/r')
g('r0=0')
g('z=1')
g('fit [15:100] y(x) "'+str(datafile)+'" using 1:2 via r0, z')
g('plot "'str(datafile)+" using 1:2, y(x)')
And the datafiles look like this:
0.000000000000000E+000 0.000000000000000E+000
9.765625000000000E-002 -2.05577406839801
0.195312500000000 -1.80843071757366
0.292968750000000 -1.59497223855229
0.390625000000000 -1.41038643815402
0.488281250000000 -1.24415910487246
0.585937500000000 -1.09103728309075
0.683593750000000 -0.948432020417034
0.781250000000000 -0.814990671718170
0.878906250000000 -0.690058106734278
0.976562500000000 -0.573781621676318
1.07421875000000 -0.468133842918065
1.17187500000000 -0.380214853165435
1.26953125000000 -0.327276191990924
1.36718750000000 -0.322127989028048
1.46484375000000 -0.347499023048631
1.56250000000000 -0.383040585116026
1.66015625000000 -0.418903776691791
1.75781250000000 -0.451056613640834
1.85546875000000 -0.478246521157531
1.95312500000000 -0.500379189881943
2.05078125000000 -0.517785215206294
2.14843750000000 -0.530920312130199
2.24609375000000 -0.540249563775338
2.34375000000000 -0.546208272940876
2.44140625000000 -0.549192158402245
2.53906250000000 -0.549557488932987
2.63671875000000 -0.547623221032223
2.73437500000000 -0.543674138702906
2.83203125000000 -0.537964470887115
2.92968750000000 -0.530721834409276
3.02734375000000 -0.522150927843818
3.12500000000000 -0.512436786265136
3.22265625000000 -0.501747552410168
3.32031250000000 -0.490236961648138
3.41796875000000 -0.478046512570940
3.51562500000000 -0.465307507703403
3.61328125000000 -0.452142758785914
3.71093750000000 -0.438668278702490
3.80859375000000 -0.424994625544276
3.90625000000000 -0.411228394904050
4.00390625000000 -0.397473277288847
4.10156250000000 -0.383831372110201
4.19921875000000 -0.370403910478473
4.29687500000000 -0.357292281706303
4.39453125000000 -0.344598174399981
4.49218750000000 -0.332423974672431
4.58984375000000 -0.320871802060817
4.68750000000000 -0.310042639379781
...
--
View this message in context: http://old.nabble.com/Negative-logscale-axis-tp31654923p31654923.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|