diff --git a/lib/Label.pm b/lib/Label.pm index 52f9b7707..bc58b2d8b 100644 --- a/lib/Label.pm +++ b/lib/Label.pm @@ -42,6 +42,9 @@ This module defines labels for the graph objects (WWPlot). package Label; use strict; +use warnings; + +use GD; #use Exporter; #use DynaLoader; diff --git a/lib/Plots/Axes.pm b/lib/Plots/Axes.pm index 8c7b08efc..24bff5e61 100644 --- a/lib/Plots/Axes.pm +++ b/lib/Plots/Axes.pm @@ -190,6 +190,9 @@ be visible after the fill, otherwise the fill will cover the axis. Default: 0 package Plots::Axes; +use strict; +use warnings; + sub new { my $class = shift; my $self = { diff --git a/lib/Plots/Data.pm b/lib/Plots/Data.pm index b0a4580dc..1c365b006 100644 --- a/lib/Plots/Data.pm +++ b/lib/Plots/Data.pm @@ -107,6 +107,9 @@ to add / change the styles. package Plots::Data; +use strict; +use warnings; + sub new { my $class = shift; my $self = { diff --git a/lib/Plots/GD.pm b/lib/Plots/GD.pm index 00caae375..287689916 100644 --- a/lib/Plots/GD.pm +++ b/lib/Plots/GD.pm @@ -23,6 +23,11 @@ See L for more details. package Plots::GD; +use GD; + +use strict; +use warnings; + sub new { my ($class, $pgplot) = @_; my $self = { diff --git a/lib/Plots/Plot.pm b/lib/Plots/Plot.pm index 7fadd7578..be88b27f4 100644 --- a/lib/Plots/Plot.pm +++ b/lib/Plots/Plot.pm @@ -23,14 +23,17 @@ See L for more details. package Plots::Plot; +use strict; +use warnings; + use Plots::Axes; use Plots::Data; -use Plots::GD; use Plots::Tikz; +use Plots::GD; sub new { my ($class, $pg, @opts) = @_; - my $size = $main::envir{onTheFlyImageSize} || 500; + my $size = $pg->{envir}{onTheFlyImageSize} || 500; my $self = { pg => $pg, @@ -158,7 +161,7 @@ sub image_type { # Tikz needs to use pdf for hardcopy generation. sub ext { my $self = shift; - return 'pdf' if ($self->{type} eq 'Tikz' && $main::displayMode eq 'TeX'); + return 'pdf' if ($self->{type} eq 'Tikz' && $self->{pg}{displayMode} eq 'TeX'); return $self->{ext}; } @@ -166,7 +169,7 @@ sub ext { # Set $plot->{tikzDebug} to 1 to just generate the tikzCode, and not create a graph. sub tikz_code { my $self = shift; - return ($self->{tikzCode} && $main::displayMode =~ /HTML/) ? '
' . $self->{tikzCode} . '
' : ''; + return ($self->{tikzCode} && $self->{pg}{displayMode} =~ /HTML/) ? '
' . $self->{tikzCode} . '
' : ''; } # Add functions to the graph. diff --git a/lib/Plots/Tikz.pm b/lib/Plots/Tikz.pm index b63948582..6e05a0d34 100644 --- a/lib/Plots/Tikz.pm +++ b/lib/Plots/Tikz.pm @@ -24,6 +24,9 @@ See L for more details. package Plots::Tikz; +use strict; +use warnings; + sub new { my ($class, $pgplot) = @_; my $image = new LaTeXImage; diff --git a/lib/WWPlot.pm b/lib/WWPlot.pm index 1b73e350e..2b9fd2467 100644 --- a/lib/WWPlot.pm +++ b/lib/WWPlot.pm @@ -169,6 +169,9 @@ These functions translate from real world to pixel coordinates. package WWPlot; use strict; +use warnings; + +use GD; #use Exporter; #use DynaLoader;