TSVPlot added
This commit is contained in:
@@ -1 +1 @@
|
||||
../tsvedit.py
|
||||
../tsv/tsvedit.py
|
||||
1
bin/tsvplot
Symbolic link
1
bin/tsvplot
Symbolic link
@@ -0,0 +1 @@
|
||||
../tsv/tsvplot
|
||||
@@ -229,7 +229,7 @@ if not os.path.exists(opts.tsv):
|
||||
|
||||
# Convert CSV -> SC
|
||||
f_sc_w=open(f_sc,'wt')
|
||||
f_csv_r=open(opts.csv,'rt')
|
||||
f_csv_r=open(opts.tsv,'rt')
|
||||
csv_reader = csv.reader(f_csv_r,
|
||||
delimiter=opts.delimiter,
|
||||
doublequote=False,
|
||||
29
tsv/tsvplot
Executable file
29
tsv/tsvplot
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ -z "$3" ]] && {
|
||||
echo "Plot2D for console.
|
||||
|
||||
Arguments
|
||||
tsvplot FILE xCol yCol [plotStyle] [preBlock]
|
||||
|
||||
e.g. tsvplot cal.tsv 2 4
|
||||
or tsvplot cal.tsv Area Weight \"with lines;\" \"set title 'test plot';\"
|
||||
preBlock may contain any GNUPlot commands.
|
||||
plotStyle contains any plotting style commands.
|
||||
|
||||
Requires csvkit and gnuplot
|
||||
"
|
||||
exit
|
||||
}
|
||||
|
||||
csvcut -t -c "$2,$3" "$1" | gnuplot -e "
|
||||
set term dumb $(tput cols) $(tput lines) enhanced;
|
||||
set datafile separator \",\";
|
||||
set xlabel '$2';
|
||||
$5
|
||||
plot '<cat' using 1:2 title '$1 $3' $4"
|
||||
|
||||
[[ $? -ne 0 ]] && {
|
||||
echo -n "Possible columns: "
|
||||
head -n 1 "$1" | tr \\t ,
|
||||
}
|
||||
Reference in New Issue
Block a user