[Graph-dev] setting different format for X and Y axis
Britt Houser
houser at cisco.com
Mon May 21 03:55:36 PDT 2007
I have a need to set both the X and Y axis formats. From my read off
the code, this doesn't appear to be supported. This is the lines I'm
referring to:
# The only time related Gnuplot code that doesn't need to be
# output first.
if ($key eq "format") {
if (defined($value)) {
if(ref($value) eq "ARRAY") {
# Print value supplying quotes for time format.
print $handle "set $key ", $$value[0]," \"",
$$value[1], "\" \n";
} else {
carp "Invalid setting for format option";
}
}
}
So only the first two elements in the array are considered. Is there
another way I'm missing to get multiple format statements entered?
Seems like if it were changed to:
# The only time related Gnuplot code that doesn't need to be
# output first.
if ($key eq "format") {
if (defined($value)) {
if(ref($value) eq "ARRAY") {
for {my $j=1;$j <=$#$value;$j+=2} {
my $i=$j-1;
# Print value supplying quotes for time format.
print $handle "set $key ", $$value[$i]," \"",
$$value[$j], "\" \n";
} else {
carp "Invalid setting for format option";
}
}
}
Then you could specify multiple axis format statements like this:
my %default_args = (
"format" => ["x", "%m/%d\\n%H:%M:%S" , "y" , "%.0f"],
...
What do you think?
thx,
britt
--
...but we also rejoice in our sufferings, because we know that
suffering produces perseverance; perseverance, character; and
character, hope. And hope does not disappoint us... Romans 5:3-5.
More information about the Graph-dev
mailing list