Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Chart::Gnuplot Time Axis output

by hmadhi (Acolyte)
on Mar 10, 2011 at 13:03 UTC ( [id://892400]=perlquestion: print w/replies, xml ) Need Help??

hmadhi has asked for the wisdom of the Perl Monks concerning the following question:

I have the following defined, however the resulted plot shows date (01/01) on x axis (time axis). I want the time axis to only show time eg 14:00
my $chart = Chart::Gnuplot->new( output => "/home/hmadhi/workspace/CommsNet/www/Plots/$kpi.png" +, title => {text=>"$kpi Success Rate on $node/$ran ($interface) + $date", }, xlabel => {text=>"Time",}, ylabel => "$kpi Succ_Rate", timeaxis => "x", ); # Create dataset object and specify the properties of the dataset my $dataSet1 = Chart::Gnuplot::DataSet->new( xdata => \@time, ydata => \@succ_rate, timefmt => '%H:%M', );

Replies are listed 'Best First'.
Re: Chart::Gnuplot Time Axis output
by broomduster (Priest) on Mar 10, 2011 at 22:23 UTC
    See Example 7 in the docs. All you need to do is define xtics with the labelfmt of your choice. Something like the following (untetsted, I don't have Chart::Gnuplot on this machine):
    my $chart = Chart::Gnuplot->new( output => "/home/hmadhi/workspace/CommsNet/www/Plots/$kpi.png" +, title => {text=>"$kpi Success Rate on $node/$ran ($interface) + $date", }, xlabel => {text=>"Time",}, ylabel => "$kpi Succ_Rate", timeaxis => "x", xtics => { labelfmt => '%H:%M', }, );
      Thanks, it is working as expected.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://892400]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-24 14:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found