Skip to content

Engine detecting problem. #1

aero opened this Issue Mar 25, 2013 · 4 comments

2 participants

aero commented Mar 25, 2013

I forcely installed (because there are some test error) PDL::Graphics::Simple on Windows strawberry perl.

I tried simple example, but it can't find existing PGPLOT engine.

pdl> use PDL::Graphics::Simple;

pdl> line([1,2,3],[1,2,3]);
Trying gnuplot (PDL::Graphics::Gnuplot)...nope
Trying pgplot (PDL::Graphics::PGPLOT::Window)...nope        <--- HERE
Trying plplot (PDL::Graphics::PLplot)...ok

drzowie commented Mar 25, 2013

Thanks, aero!

Hmmm, it would be helpful to see why PGPLOT is failing to load.

(1) please find the error message for PGPLOT. You can do this with:

pdl> use PDL::Graphics::Simple;
pdl> $w=pgswin(engine=>'PGPLOT'); # should fail
pdl> print $PDL::Graphics::Simple::mods->{pgplot}->{msg};

(2) Does 'use PDL::Graphics::PGPLOT::Window' work properly on your system?


aero commented Mar 25, 2013


pdl> use PDL::Graphics::Simple;

pdl> $w=pgswin(engine=>'PGPLOT'); # should fail  <-- Can't see any error message

pdl> print $PDL::Graphics::Simple::mods->{pgplot}->{msg};
Use of uninitialized value in print at (eval 472) line 5, <IN> line 3.

yes, This code works well.

pdl> use PDL::Graphics::PGPLOT::Window

pdl> $win = pgwin();

pdl> $win->line([1,2,3],[1,2,3])
aero commented Mar 27, 2013

Hi again.
I solved the problem.
On windows, PDL uses for PGPLOT drawing canvas.
GrWinC's PGPLOT device names on Windows are GW and CGW.

This is patch for that.

--- C:\strawberry-perl-\perl\site\lib\PDL\Graphics\Simple\   Tue Mar 26 07:29:04 2013
+++ C:\strawberry-perl-\perl\site\lib\PDL\Graphics\Simple\       Wed Mar 27 16:37:13 2013
@@ -63,6 +63,10 @@
        $mod->{disp_dev} = 'XWINDOW';
     } elsif($mod->{devices}->{'XSERVE'} ) {
        $mod->{disp_dev} = 'XSERVE';
+    } elsif($mod->{devices}->{'CGW'} ) {
+        $mod->{disp_dev} = 'CGW';
+    } elsif($mod->{devices}->{'GW'} ) {
+        $mod->{disp_dev} = 'GW';
     } else {
        $mod->{ok} = 0;
        return 0;
drzowie commented Mar 27, 2013

Terrific! Thanks very much, Aero! I've included your patch (or a facsimile) and fixed a related wart at the same time. I also gave you collaborator access to the tree, so you can push things up yourself if the mood takes you.

Warm regards,

@drzowie drzowie closed this Mar 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.