plot source using 1:2 with points pointtype 7 lw 2.0 lc rgb "#FF0000"
should look like:
plot source using ((360-$1+90)%360):2 with points pointtype 7 lw 2.0 lc rgb "#FF0000"
set datafile separator ";"
set output 'out.png'
set terminal png truecolor enhanced medium size 350,350 dashlength 0.5 background rgb "#FFFFFF"
set key textcolor rgb "#000000"
unset xlabel
unset ylabel
unset ytics ## disable this then ok
unset xtics ## disable this then ok
unset border
set polar
set angles degree
grids= 30
#set angles radian
#grids= 3.141/4.
set clip
set style line 100 lt 1 lw 1 linecolor rgb "#000000"
set grid polar grids back ls 100
set format r "%3.0f"
set rtics (1,5,50)
set logscale r
set rrange [0.1:50]
plot 'test2' using 1:2 with points pointtype 7 lw 0.5 lc rgb "#FF0000" title ""
def averageDirectionRadius(rPhiList,degreeORreadian="deg"):
import math
## calculates a vector average of a list of [r,phi] pairs
## call: averageDirectionRadius([[5,0.3],[1,2]]) ## if you use radian do ([[5,0.3],[1,2]],degreeORreadian="pi")
## returns a proper vector average (R,PHI) of the r,phi pairs in rPhiList
## karl Wachs july 14, 2015
## use as you see fit.
if degreeORreadian.upper().find("PI") ==-1:
conv= math.pi/180.
else:
conv =1.
if len( rPhiList ) ==0:
return 0,1
phiAverage=0.
rAverage=0.
xAv=0
yAv=0
for rPhiPair in rPhiList:
if len(rPhiPair) !=2: continue # this is an error ignore, user should add an error message
if rPhiPair[0] ==0.: continue
x = math.cos(rPhiPair[1]*conv)*rPhiPair[0]
y = math.sin(rPhiPair[1]*conv)*rPhiPair[0]
xAv +=x
yAv +=y
R = math.sqrt(xAv*xAv+yAv*yAv)
if R>0:
phi = math.acos(xAv/R) / conv
if yAv <0: phi*=-1.
else:
phi = 0
return R, phi
#test it:
print averageDirectionRadius([[1.,300.01],[1.,45]], degreeORreadian="deg")
print averageDirectionRadius([[2.,300.01],[1.,45]], degreeORreadian="deg")
print averageDirectionRadius([[1.,90.01],[1.,45]], degreeORreadian="deg")
print averageDirectionRadius([[2.,90.01],[1.,45]], degreeORreadian="deg")
print averageDirectionRadius([[2.,90.01],[1.,45]], degreeORreadian="deg")
print averageDirectionRadius([[2.,90.01],[1.,45],[1.,45],[1.,45],[1.,45],[1.,45]], degreeORreadian="deg")
def averageDirectionRadius(self,rPhiList,degreeORreadian="deg")
print self.averageDirectionRadius([[1.,300.01],[1.,45]], degreeORreadian="deg"):
kw123 wrote:what do you want to keep? the grid and numbers I suppose?
set border linecolor "#444444"
unset border
kw123 wrote:the screwy gridlines are actually shown on the gnuplot example site!
but I can live with it until (if?) Gnuplot gives the ability to control tic color independently.
kw123 wrote:you should start looking into MATPLOT. The learning curve is steep, but you can set anything you like.
#! /usr/bin/env gnuplot
# -*- coding: utf-8 -*-
reset
source = "/Users/.../Dropbox/Public/charts.csv"
windSource = "/Users/.../Dropbox/Public/wind.csv"
set datafile separator ","
set output '/Users/.../Dropbox/Public/wind.png'
set terminal pngcairo truecolor enhanced size 300,300 font "Lato Light,11" dashlength 0.5 background rgb "#000000"
unset xtics
unset xlabel
unset ytics
unset ylabel
unset key
# Setting and unsetting the border to control tic color.
set border lc "#666666"
unset border
set angles degrees
set polar
set size square
set clip
set style line 100 lw 0.75 lc rgb "#444444"
set grid polar 45 back ls 100
set rrange [0:20]
set rtics (5,10,15,20) offset -1.5,1.5 font "Lato Light,8" tc rgb "#444444"
# Palette settings.
set palette maxcolors 4
set palette defined (5 "blue", 10 "green", 15 "yellow", 20 "red")
set cbrange [0:20]
unset colorbox
# Set margins to center the graph nicely.
set tmargin 2.5
set lmargin 5
set rmargin 5
set bmargin 2.5
# Set ordinal labels.
set label "N" at +00.0,+21.5 center tc rgb "#FFFFFF"
set label "NE" at +16.0,+16.0 center tc rgb "#FFFFFF"
set label "E" at +22.0,-00.5 center tc rgb "#FFFFFF"
set label "SE" at +16.0,-16.0 center tc rgb "#FFFFFF"
set label "S" at +00.0,-22.5 center tc rgb "#FFFFFF"
set label "SW" at -16.5,-16.5 center tc rgb "#FFFFFF"
set label "W" at -22.0,-00.5 center tc rgb "#FFFFFF"
set label "NW" at -16.0,+16.0 center tc rgb "#FFFFFF"
plot source u 25:26:26 w impulses lw 1 lc palette, \
windSource u 2:3:3 w impulses lw 2 lc "#FFFFFF"
#! /usr/bin/env gnuplot
# -*- coding: utf-8 -*-
reset
source = "/Users/.../Dropbox/Public/wind_chart_data/wind.csv"
set datafile separator ","
set output '/Users/.../Dropbox/Public/wind.png'
set terminal pngcairo truecolor enhanced size 300,300 font "Lato Light,11" dashlength 0.5 background rgb "#000000"
stats source using 3 nooutput
unset xtics
unset xlabel
unset ytics
unset ylabel
unset key
# Setting and unsetting the border to control tic color.
set border linecolor "#666666"
unset border
set angles degrees
set polar
set size square
set clip
set style line 100 linewidth 0.75 linecolor rgb "#444444"
set grid polar 45 back linestyle 100
set style textbox opaque
# Set the max rrange to a nice "even" number.
range_factor = 5.0
max_range = STATS_max
if (max_range == 0) {max_range = 1}
max_range = ceil(abs(max_range) / range_factor) * range_factor
set rrange [0 : max_range]
# Setting dynamic tics and labeling depending on the value of data to be charted.
offset_x = -1.0
offset_y = 1.35
if (max_range <= 5.0) {set rtics (1, 2, 3, 4, 5) offset offset_x,offset_y font "Lato Light,8" textcolor rgb "#444444"}
if (max_range > 5.0) {set rtics (2, 4, 6, 8, 10) offset offset_x,offset_y font "Lato Light,8" textcolor rgb "#444444"}
if (max_range > 10.0) {set rtics (10, 20, 30, 40, 50) offset offset_x,offset_y font "Lato Light,8" textcolor rgb "#444444"}
if (max_range > 50.0) {set rtics (20, 40, 60, 80, 100) offset offset_x,offset_y font "Lato Light,8" textcolor rgb "#444444"}
if (STATS_max == 0.0) {set label "CALM" at 0.0,-2.5 center font "Lato Light,10" textcolor rgb "#FFFFFF" boxed}
if (STATS_max > 75.0) {set label "HOLY CRAP!" at +0.0,-2.5 center font "Lato Light,10" textcolor rgb "#FF0000" boxed}
# Plot the actual data.
plot '/Users/.../Dropbox/Public/wind_chart_data/wind_1.csv' using 2:3:3 with impulses linewidth 1 linecolor "#111111",\
'/Users/.../Dropbox/Public/wind_chart_data/wind_2.csv' using 2:3:3 with impulses linewidth 1 linecolor "#222222",\
'/Users/.../Dropbox/Public/wind_chart_data/wind_3.csv' using 2:3:3 with impulses linewidth 1 linecolor "#333333",\
'/Users/.../Dropbox/Public/wind_chart_data/wind_4.csv' using 2:3:3 with impulses linewidth 1 linecolor "#444444",\
'/Users/.../Dropbox/Public/wind_chart_data/wind_5.csv' using 2:3:3 with impulses linewidth 1 linecolor "#555555",\
'/Users/.../Dropbox/Public/wind_chart_data/wind_6.csv' using 2:3:3 with impulses linewidth 1 linecolor "#666666",\
'/Users/.../Dropbox/Public/wind_chart_data/wind_7.csv' using 2:3:3 with impulses linewidth 1 linecolor "#777777",\
'/Users/.../Dropbox/Public/wind_chart_data/wind_8.csv' using 2:3:3 with impulses linewidth 1 linecolor "#888888",\
'/Users/.../Dropbox/Public/wind_chart_data/wind_9.csv' using 2:3:3 with impulses linewidth 1 linecolor "#999999",\
'/Users/.../Dropbox/Public/wind_chart_data/wind_10.csv' using 2:3:3 with impulses linewidth 3 linecolor "#FF0000"
#! /usr/bin/env python2.6
# -*- coding: utf-8 -*-
import os.path
from os import system
csvFilePath = "/Users/TV/10DayForecast.csv"
dateTime = str(indigo.server.getTime())
day1 = str(indigo.devices[379370551].states["d01_date"])
day2 = str(indigo.devices[379370551].states["d02_date"])
day3 = str(indigo.devices[379370551].states["d03_date"])
day4 = str(indigo.devices[379370551].states["d04_date"])
day5 = str(indigo.devices[379370551].states["d05_date"])
day6 = str(indigo.devices[379370551].states["d06_date"])
day7 = str(indigo.devices[379370551].states["d07_date"])
day8 = str(indigo.devices[379370551].states["d08_date"])
day9 = str(indigo.devices[379370551].states["d09_date"])
day10 = str(indigo.devices[379370551].states["d10_date"])
highTemp1 = str(int(indigo.devices[379370551].states["d01_high"]))
highTemp2 = str(int(indigo.devices[379370551].states["d02_high"]))
highTemp3 = str(int(indigo.devices[379370551].states["d03_high"]))
highTemp4 = str(int(indigo.devices[379370551].states["d04_high"]))
highTemp5 = str(int(indigo.devices[379370551].states["d05_high"]))
highTemp6 = str(int(indigo.devices[379370551].states["d06_high"]))
highTemp7 = str(int(indigo.devices[379370551].states["d07_high"]))
highTemp8 = str(int(indigo.devices[379370551].states["d08_high"]))
highTemp9 = str(int(indigo.devices[379370551].states["d09_high"]))
highTemp10 = str(int(indigo.devices[379370551].states["d10_high"]))
lowTemp1 = str(int(indigo.devices[379370551].states["d01_low"]))
lowTemp2 = str(int(indigo.devices[379370551].states["d02_low"]))
lowTemp3 = str(int(indigo.devices[379370551].states["d03_low"]))
lowTemp4 = str(int(indigo.devices[379370551].states["d04_low"]))
lowTemp5 = str(int(indigo.devices[379370551].states["d05_low"]))
lowTemp6 = str(int(indigo.devices[379370551].states["d06_low"]))
lowTemp7 = str(int(indigo.devices[379370551].states["d07_low"]))
lowTemp8 = str(int(indigo.devices[379370551].states["d08_low"]))
lowTemp9 = str(int(indigo.devices[379370551].states["d09_low"]))
lowTemp10 = str(int(indigo.devices[379370551].states["d10_low"]))
precip1 = str(indigo.devices[379370551].states["d01_pop"])
precip2 = str(indigo.devices[379370551].states["d02_pop"])
precip3 = str(indigo.devices[379370551].states["d03_pop"])
precip4 = str(indigo.devices[379370551].states["d04_pop"])
precip5 = str(indigo.devices[379370551].states["d05_pop"])
precip6 = str(indigo.devices[379370551].states["d06_pop"])
precip7 = str(indigo.devices[379370551].states["d07_pop"])
precip8 = str(indigo.devices[379370551].states["d08_pop"])
precip9 = str(indigo.devices[379370551].states["d09_pop"])
precip10 = str(indigo.devices[379370551].states["d10_pop"])
csvFile = open(csvFilePath, "w")
element = (day1 + "," + highTemp1 + "," + highTemp1 + "°," + lowTemp1 + "," + lowTemp1 + "°," + precip1 + "\n" +
day2 + "," + highTemp2 + "," + highTemp2 + "°," + lowTemp2 + "," + lowTemp2 + "°," + precip2 + "\n" +
day3 + "," + highTemp3 + "," + highTemp3 + "°," + lowTemp3 + "," + lowTemp3 + "°," + precip3 + "\n" +
day4 + "," + highTemp4 + "," + highTemp4 + "°," + lowTemp4 + "," + lowTemp4 + "°," + precip4 + "\n" +
day5 + "," + highTemp5 + "," + highTemp5 + "°," + lowTemp5 + "," + lowTemp5 + "°," + precip5 + "\n" +
day6 + "," + highTemp6 + "," + highTemp6 + "°," + lowTemp6 + "," + lowTemp6 + "°," + precip6 + "\n" +
day7 + "," + highTemp7 + "," + highTemp7 + "°," + lowTemp7 + "," + lowTemp7 + "°," + precip7 + "\n" +
day8 + "," + highTemp8 + "," + highTemp8 + "°," + lowTemp8 + "," + lowTemp8 + "°," + precip8 + "\n" +
day9 + "," + highTemp9 + "," + highTemp9 + "°," + lowTemp9 + "," + lowTemp9 + "°," + precip9 + "\n" +
day10 + "," + highTemp10 + "," + highTemp10 + "°," + lowTemp10 + "," + lowTemp10 + "°," + precip10)
csvFile.write(element)
csvFile.close()
system('/opt/local/bin/gnuplot /Library/Application\ Support/Perceptive\ Automation/Indigo\ 6/Scripts/10DayForecast.gp')
Users browsing this forum: No registered users and 2 guests