# HG changeset patch # User viric@llimona # Date 1161556520 -7200 # Node ID 2bdd3f8b7864e0e03ec45401a7ee6bf8001d173c # Parent 9aa865195c24fb65ace7923da44faa2720e8a6c8 Diverses millores: New, gnuplots, ... diff -r 9aa865195c24 -r 2bdd3f8b7864 gamma.tk --- a/gamma.tk Sun Oct 22 22:56:16 2006 +0200 +++ b/gamma.tk Mon Oct 23 00:35:20 2006 +0200 @@ -1,4 +1,4 @@ -#!/bin/wish +#!/usr/bin/wish set wheight 400 set wwidth 800 @@ -58,6 +58,7 @@ set mFile [menu .mb.mFile] .mb add cascade -label File -menu .mb.mFile +$mFile add command -label New -command new_points $mFile add command -label Load -command load_file $mFile add command -label Save -command save_file $mFile add separator @@ -225,16 +226,18 @@ return } set fd [open $file w] - puts "# plot for gnuplot" - puts "# plot 'data' index 0 title 'vermell', 'data' index 1 title 'verd', 'data' index 2 title 'blau'" + puts $fd "# plot for gnuplot" + puts $fd "# plot 'data' index 0 title 'vermell', 'data' index 1 title 'verd', 'data' index 2 title 'blau'" foreach t { rpoints gpoints bpoints } { + puts $fd "# $t" foreach i [set $t] { puts -nonewline $fd [join $i " "] puts $fd "" } if { $t != "bpoints"} { puts $fd "" + puts $fd "" } } @@ -267,7 +270,7 @@ } } } else { - if { [string index $line] != "#" } { + if { [string index $line 0] != "#" } { lappend ${type}points [split $line " "] } } @@ -283,5 +286,16 @@ prepare_colors_newpoint } +proc new_points { } { + global rpoints gpoints bpoints + + set rpoints {{0 0.} {65535 1.}} + set gpoints {{0 0.} {65535 1.}} + set bpoints {{0 0.} {65535 1.}} + + prepare_colors_newpoint +} + + # Prepare the colors for the user, for the first time! prepare_colors_newpoint diff -r 9aa865195c24 -r 2bdd3f8b7864 graph.plot --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graph.plot Mon Oct 23 00:35:20 2006 +0200 @@ -0,0 +1,9 @@ +#!/usr/bin/gnuplot + + +plot 'sobretaula.gamma' index 0 title 'vermell' with linespoints, \ + 'sobretaula.gamma' index 1 title 'verd' with linespoints, \ + 'sobretaula.gamma' index 2 title 'blau' with linespoints, \ + (x / 65535)**2.2 title "sRGB" with lines + +pause -1