----- Original Message ----- 
From: "Sina Türeli" <[EMAIL PROTECTED]>
To: "perl Sisyphus" <[EMAIL PROTECTED]>; <[email protected]>
Sent: Wednesday, July 09, 2008 7:47 AM
Subject: Re: [Perldl] PDL TriD and PGPlot


That error was using the PDL:PGPLOT

If I only try to use PGPLOT it gives the error

 %PGPLOT, Unrecognized device type
 %PGPLOT, Invalid device specification: /xserve
 %PGPLOT, PGENV: selected graphics device is not open
 %PGPLOT, PGBBUF: selected graphics device is not open
 %PGPLOT, PGMTXT: selected graphics device is not open
 %PGPLOT, PGMTXT: selected graphics device is not open
 %PGPLOT, PGMTXT: selected graphics device is not open
 %PGPLOT, PGEBUF: selected graphics device is not open
 %PGPLOT, PGPT: selected graphics device is not open

I have set all the enviroment path and other variables...

=================================

Xserve is the default device - grwnd.exe in this case, I think.
That being so, you'll need grwnd.exe in your path. However, while it 
generally works ok for a one-off display, it can be rather buggy if you want 
to display more than one graph, or run more than one instance of grwnd.exe.

For that reason, I always specify /PNG as the device:

set PGPLOT_DEVICE=/PNG
set DISPLAY=1
set PGPLOT_FONT=C:\_32\pgplot\bin\grfont.dat

>From memory, DISPLAY is used by t/pgplot.t from the PDL source. (I don't 
recall whether it is used elsewhere).
And PGPLOT_FONT needs to specify the location (and name) of grfont.dat.

If you have the PDL source, try cd'ing to the top level folder of the source 
and run:

perl t/pgplot.t

For me, that produces:

--------------------------------------
C:\_32\comp\PDL>perl t/pgplot.t
1..12
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6 # skip interactive tests not run since environment var PDL_INT not set
ok 7
ok 8
ok 9
ok 10
ok 11 # skip interactive tests not run since environment var PDL_INT not set
PGPLOT /png: writing new file as pgplot.png_2
ok 12
--------------------------------------

and 2 png files (pgplot.png and pgplot.png_2) are created in the cwd.
(I think the interactive tests require /xserve - and grwnd.exe is too buggy 
to enable them to work.)

If there are still problems, it might be a good idea to first download the 
PGPLOT source, cd to the top level source folder and run (still with the 
PGPLOT_DEVICE set to /PNG):

perl test.pl

That should create 12 graphs (as separate png files) and also produce the 
following output to the console:

--------------------------------------
============== Running test1.p ==============

Testing simple point plot...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

============== Running test2.p ==============


Testing advanced point and line plot routines...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

============== Running test3.p ==============


Testing histogram routines...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

============== Running test4.p ==============


Testing greyscale, contour and vector routines...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

32768 bytes read
16384 element image stored
Plotting...
============== Running test5.p ==============


Testing perl function passing to pgfunx, pgfunx, pgfunt...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

============== Running test6.p ==============


Testing perl function passing to pgconx...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

32768 bytes read
16384 element image stored
Plotting...
============== Running test7.p ==============


Testing pghi2d routine...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

32768 bytes read
16384 element image stored
Plotting...
============== Running test8.p ==============


Testing scalars in array routines...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

============== Running test9.p ==============


Testing PGPLOT 5.0 colour image routines...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

32768 bytes read
16384 element image stored
Plotting...
============== Running test10.p ==============


Testing multiple ways of passing things...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

Plotting...
--------------------------------------
Points: scalars passed one by one
Image: packed char string
--------------------------------------
Points: 1D array passed by glob
Image: 1D array passed by glob
--------------------------------------
Points: 1D array passed by reference
Image: 1D array passed by reference
--------------------------------------
Line: 1D cross-section of 2D array
Image: 2D array passed by reference
--------------------------------------
============== Running test11.p ==============


Testing Object-Oriented stuff...

PGPLOT module version 2.20

PGPLOT v5.2.2 library


Testing Square Objects...
Square plot method...
Square expand and rotate methods...
Inheriting Square methods in Triangles...
Fun isn't it?
============== Running test12.p ==============


Testing some new PGPLOT 5.2.0 routines...

PGPLOT module version 2.20

PGPLOT v5.2.2 library

32768 bytes read
16384 element image stored
Plotting...
Testing pgqdt() - 11 drivers found...
1:  /GIF 4 (Graphics Interchange Format file, landscape orientation) 57
2:  /VGIF 5 (Graphics Interchange Format file, portrait orientation) 56
3:  /GW 3 (grwnd.exe on Win32) 20
4:  /CGW 4 (grwnd.exe on Win32; colors compatible with /CPS) 49
5:  /NULL 5 (Null device, no output) 24
6:  /PNG 4 (Portable Network Graphics file) 32
7:  /TPNG 5 (Portable Network Graphics file - transparent background) 57
8:  /PS 3 (PostScript file, landscape orientation) 40
9:  /VPS 4 (PostScript file, portrait orientation) 39
10:  /CPS 4 (Colour PostScript file, landscape orientation) 47
11:  /VCPS 5 (Colour PostScript file, portrait orientation) 46
--------------------------------------

(Not sure if the same drivers will be found on your box.)

That's about as good as it gets on native Windows - for the moment, anyway. 
The potential to improve on the graphics capabilities certainly exists, but 
no-one has yet done the work afaik.

TriD should be do-able. The stumbling block for me has been how to get 
opengl set up on windows (though I know some have done it). Once opengl has 
been set up, building PDL with TriD would (hopefully) be straightforward. 
Sina, if you know what's involved in getting opengl up and running on 
windows, and like to share the knowledge, I'll see what can be done (wrt PDL 
and TriD).

I don't use Cygwin, but I believe the PDL graphics capabilities are somewhat 
better on it (if you want to go down that path).

Cheers,
Rob



_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to