NAME

PGPLOTx::Constants - Constants for use with PGPLOT

VERSION

version 0.02

SYNOPSIS

# import GREEN
use PGPLOTx::Constants 'GREEN';

# don't shout, import GREEN as green
use PGPLOTx::Constants 'GREEN' => { -as => 'green' } ;

# import all of the colors
use PGPLOTx::Constants -colors;

# import all of the colors, lower case 'em so your code doesn't shout
# but don't lower case the fots
use PGPLOTx::Constants -colors, { -as => 'lc' }, -fonts ;

# lower case everything that is imported
use PGPLOTx::Constants { as => 'lc' }, -colors, -fonts ;

# support for user interfaces
use PGPLOTx::Constants qw( list_constants coerce_constant )

if ( $color eq '-list' ) {
  say join "\n", list_constants( 'colors' );
  exit 0;
}

$color = coerce_constant( colors => $color );

DESCRIPTION

This module provides a number of constants for use with the PGPLOT plotting package.

Exporter::Tiny is used to provide the exported symbols, so its facilities can be used to customize the import experience, as shown in the "SYNOPSIS".

The constants can be imported individually, or as sets via associated tags.

The following sets are available:

SUBROUTINES

coerce_constant

 $value = coerce_constant( $tag, $name );

If $name is a recognized name or alias for constants associated with the tag $tag, return the constant's value, otherwise throw an exception.

Aliases include the lower-cased name, and names with underscores replaced with hyphens. For example, the following names are accepted for the color constant GREEN_YELLOW:

GREEN_YELLOW  GREEN-YELLOW
green_yellow  green-yellow

list_constants

@names = list_constants( $tag )

Return all names accepted by "coerce_constant" for the specified tag. Throws if $tag is not recognized.

INTERNALS

SUPPORT

Bugs

Please report any bugs or feature requests to bug-pgplotx-constants@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=PGPLOTx-Constants

Source

Source is available at

https://gitlab.com/djerius/pgplotx-constants

and may be cloned from

https://gitlab.com/djerius/pgplotx-constants.git

SEE ALSO

Please see those modules/websites for more information related to this module.

AUTHOR

Diab Jerius djerius@cpan.org

COPYRIGHT AND LICENSE

This software is Copyright (c) 2026 by Smithsonian Astrophysical Observatory.

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007