Chart-Graph

 view release on metacpan or  search on metacpan

Graph/Xmgrace.pm  view on Meta::CPAN


#
#
# Subroutine _is_available_option($$$)
#
# Description: Modest helper subroutine to loop through available
#              options for more complex Xmgrace options and return
#              true if a match is found.
#
#
sub _is_available_option($$$) {
    my $key = shift;
    my $to_match = shift;
    my $avail_options_ref = shift;

    if (exists($avail_options_ref->{$key})) {
	foreach my $option (@{$avail_options_ref->{$key}}) {
	    if ($to_match =~ m/$option/i) { 
		return($option);
	    }
	}

Graph/Xmgrace.pm  view on Meta::CPAN

    return 0;
}


# 
# Subroutine: _run_app() 
#
# Description: to simplify calls to external applications
# 

sub _run_app($@ ) {
  my $application = shift;
  my @arguments = @_;
  my $command_str;

        # Run application
        # Test if an executable file exists as specified location
        if (-x "$application") {
          # Try to run application.  Quit if that fails.
          $command_str = join(' ', $application, @arguments);
          my $rc = 0xffff & system ($command_str);

Graph/Xmgrace/Axis.pm  view on Meta::CPAN

sub tick_options ($) {
    $self = shift;
    return $self->{options}->{"tick options"};
}

sub ticklabel_options ($) {
    $self = shift;
    return $self->{options}->{"ticklabel options"};
}

sub print($$ ) {
    my $self = shift;
    my $handle = shift;
    my $string = "";
    my $substr = "";

    foreach $option (@{ $self->{"print_order"} }) {
	my $option_ref = $self->{"options"};

	if ($option eq "status" or $option eq "in_out_status") {   
	    

Graph/Xmgrace/Base_Dataset_Option.pm  view on Meta::CPAN

	return 0;
    }

    print $handle "@";
    print $handle ' ' x $length;
    print $handle "$string"; 

    return 1;                   # just for fun 
} 

sub print($$$ ) {
    my $self = shift;
    my ($handle, $set) = @_;
    my $string = "";
  
    foreach $option (@{ $self->{"print_order"} }) {
	my $option_ref = $self->{"options"};

	if ($option eq "status" or $option eq "in_out_status") {   
	  
	    # we first check the status of the option, whether it's on/off

Graph/Xmgrace/Base_Option.pm  view on Meta::CPAN

    my $self = shift;
    my ($handle, $string, $length) = @_;

    print $handle "@";
    print $handle ' ' x $length;
    print $handle "$string"; 

    return 1;                   # just for fun 
} 

sub print($$ ) {
    my $self = shift;
    my $handle = shift;
    my $string = "";
    my $substr = "";		# for making arrays into a string

    foreach $option (@{ $self->{"print_order"} }) {
	my $option_ref = $self->{"options"};

	if ($option eq "status" or $option eq "in_out_status") {   
	  

Graph/Xmgrace/Dataset_Options.pm  view on Meta::CPAN

    my $val = shift;
    $self->{options}->{"symbol char"} = $val;    
}

sub char_font ($$) {
    my $self = shift;
    my $val = shift;
    $self->{options}->{"char font"} = $val;    
}

sub print($$$ ) {
    my $self = shift;
    my ($handle, $set) = @_;
    my $string = "";
  
    foreach $option (@{ $self->{"print_order"} }) {
	my $option_ref = $self->{"options"};

	if ($option eq "symbol type") {
	    $string = "$set $self->{name} $option_ref->{$option}\n";
	} else {

Graph/Xmgrace/Graph_Options.pm  view on Meta::CPAN

			"bar hgap" => '0.000000',
			"fixedpoint" => "off",
			"fixedpoint type" => "0",
			"fixedpoint xy" => ["0.000000","0.000000"],
			"fixedpoint format" => "general general",
			"fixedpoint prec" => ["6","6"],
			"with" => $graph_number,
		       };
}

sub print($$ ) {
    my $self = shift;
    my $handle = shift;
    my $string = "";
    my $substr = "";		# for making arrays into a string

    foreach $option (@{ $self->{"print_order"} }) {
	my $option_ref = $self->{"options"};

	# print function handles both scalars and lists
	if ($self->{name}) {

Graph/Xmgrace/Graph_Options.pm  view on Meta::CPAN

    $self->{print_order} = ["title","font","size","color"];
    $self->{length} = 4;
    $self->{options} = {
			"title" => '""',
			"font" => "0",
			"size" => "1.250000",
			"color" => "1",					
		       };
}

sub print($$ ) {
    my $self = shift;
    my $handle = shift;
    my $string = "";
    my $substr = "";		# for making arrays into a string

    foreach $option (@{ $self->{"print_order"} }) {
	my $option_ref = $self->{"options"};
	
	if ($option eq "title") {
	    $string = "$self->{name} \"$option_ref->{$option}\"\n";

Graph/Xmgrace/Graph_Options.pm  view on Meta::CPAN


sub _init {
    my $self = shift;  
    $self->{name} = "extra options";
    $self->{length} = 4;
    $self->{options} = {"extras" => undef,};	# extra options are \n delimited
}


# just dumps, verbatim, whatever the user inputs
sub print($$ ) {
    my $self = shift;
    my $handle = shift;
    my $string = "";
    my @xtra_opts;
    my $pre_sub = $self->{options}->{extras};
    if ($pre_sub) {
	@xtra_opts = split(/;\n*\s*/, $pre_sub);
    
	foreach $option (@xqtra_opts) {
	    $self->_printline($handle, "$option\n", $self->{"length"});



( run in 0.749 second using v1.01-cache-2.11-cpan-65fba6d93b7 )