Hello I'm trying to plot hodographs slmlar to this so far i have drawn
the points and lines just fine but have ran into some issues labeling
the points.
here is an example of what I'm looking for.
http://www.tornadohead.com/eventhodos/050403top18.gif
When i try and use this to draw the labels that aren't tied to the
points it works but its not in polar coords? even tho the chart is.
for x,y in zip(dir,speed):
xrad = math.radians(x)
g('set label "%d %d" at %d,%d' % (x,y,x,y))
also i need to figure out how to label points with a height.
so far i have this it plots the a sample of lines and points but the
labels are all wrong i cant seem to find anything on the net about
this.
Tyler.
from numpy import *
import Gnuplot, Gnuplot.funcutils
import math
# in deg / speed
dir = 180,90,270
speed = 88,29,55
out = []
for x,y in zip(dir,speed):
xrad = math.radians(x)
out.append([xrad,y])
plot1 = Gnuplot.PlotItems.Data(out, with_="lines", title="Quadratic")
plot2 = Gnuplot.PlotItems.Data(out, with_="points", title="G00se")
# Plot with GNUPLOT
g = Gnuplot.Gnuplot(debug=1)
g('set terminal png')
g('set output "output.png"')
g('set size square')
g('set xrange [-100:100]')
g('set yrange [-100:100]')
g('set polar')
g('set grid polar')
g('set size ratio -1')
for x,y in zip(dir,speed):
xrad = math.radians(x)
g('set label "%d %d" at %d,%d' % (x,y,x,y))
g.plot(plot1,plot2)
|