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

Is there a way in the Graph module to keep the x_label but remove the x grid line associated with it? I'm graphing 15 minute increments and want to see the hourly label value for each 15 minutes but I want the graph x grid lines to show up only for each full hour such as 11:00 or 12:00. The data needs to graph for every 15 minute increment. Thanks. Chuck Dial

Replies are listed 'Best First'.
Re: perl Graph x_label_skip
by roboticus (Chancellor) on Aug 15, 2009 at 12:36 UTC
    cdial:

    The Graph module doesn't draw/render graphs, with or without labels. Why not:

    1. specify the full name of the module you're talking about, and
    2. give us a short bit of code that exemplifies the problem

    Then we might be able to assist.

    ...roboticus
      package Ari::Graph; use GD::Graph::hbars; use GD::Graph::bars; my @data = ('bob', 'carol', 'alice',5.55,0,0,54.43.0.65.83,0,18.21,0,0,17.29,0); my $graph = new GD::Graph::hbars(400,425); $graph->set(x_labels_vertical =>0, valign => '1', x_label_skip =>2) $graph->plot(\@data) or die "Graph Error"; The x_label_skip =>2 will get rid of the line label for carol and the horizontal graph line goes away. I'd like to keep the line label of carol and remove the horizontal line in the graph. Not the data line but the grid line. Thanks, Chuck Dial
        cdial:

        I pasted the code into a text window, but it doesn't compile. I fixed the obvious errors, getting:

        #!/usr/bin/perl -w use strict; use warnings; package Ari::Graph; use GD::Graph::hbars; use GD::Graph::bars; my @data = ('bob', 'carol', 'alice', 5.55, 0, 0, 54.43.0.65.83, 0, 18. +21, 0, 0, 17.29, 0); my $graph = new GD::Graph::hbars(400,425); $graph->set(x_labels_vertical =>0, valign => '1', x_label_skip =>2); $graph->plot(\@data) or die $graph->error;

        But when I run it, I get the error:

        roboticus@B001C23219B6C /Work/Perl/PerlMonks [11:03:17] $ ./789153.pl No attribute 'valign' Invalid data set: 0 at ./789153.pl line 13.

        If you get me a better bit of sample code, I'll be happy to take another look at it...

        ...roboticus