You can start multiple instances of a device.
http://pdl.perl.org/?docs=Graphics/PGPLOT&title=PDL::Graphics::PGPLOT
Search for new_window.
The preferred method is to use PDL::Graphics::PGPLOT::Window 
http://search.cpan.org/~csoe/PDL-2.4.3/Graphics/PGPLOT/Window/Window.pm

I don't know why this isn't on the PDL website, there seems to be a link error.

You can also use the pdl shell to find the documentation by using 'help 
command' or if you don't know the command but some words around it 'apropos 
word' {alias for apropos is '??'}. '?? pgplot ' will bring up a few screens of 
information. 'help PDL::Graphics::PGPLOT::Window' will bring up the same 
information as the cpan link above.

C:\pdl2
pdl> use PDL::Graphics::PGPLOT::Window

pdl> $win = pgwin(Device => '/gw')

pdl> $x=sequence(6218)/1000

pdl> p $x(0:10)
[0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01]

pdl> $win->line(sin($x))
line: xmin=0; xmax=; ymin=-0.999999940395355; ymax=1

pdl> $win1 = pgwin(Device => '/gw')

pdl> $win1->line(cos($x))
line: xmin=0; xmax=; ymin=-0.999999940395355; ymax=1

pdl> $win2 = pgwin(Device => '/gw')

pdl> $win2->line(tan($x))
line: xmin=0; xmax=; ymin=-4909.826171875; ymax=2570.82348632813

hope that helps.

CLIFF SOBCHUK
Core RF Engineering
Phone 613-667-1974   ecn: 8109-71974
mobile 403-819-9233
yahoo: sobchuk
www.ericsson.com<http://www.ericsson.com/>

"The author works for Telefonaktiebolaget L M Ericsson ("Ericsson"), who is 
solely responsible for this email and its contents. All inquiries regarding 
this email should be addressed to Ericsson. The web site for Ericsson is 
www.ericsson.com."

This Communication is Confidential. We only send and receive email on the basis 
of the terms set out at 
www.ericsson.com/email_disclaimer<http://www.ericsson.com/email_disclaimer>



________________________________
From: Fabio D'Alfonso [mailto:[email protected]]
Sent: Sunday, January 15, 2012 11:27 AM
To: [email protected]
Subject: [Perldl] Sharing Graphics Devices

Hi,
I am trying to figure how to use graphics and I am not understanding if there 
is a way to pass the device among different modules.

The minimal inderstanding I have is that the device is accessed in different 
ways by different modules.
So e.g. the Cartography module use this way:

$w = pgwin('/GW')
$a = earth_coast()->glue(1,graticule(10,1));
$w->lines($a->apply(t_mercator)->clean_lines);

the PGPLOT use this:

the use PDL::Graphics::PGPLOT  use this:

dev('/GW', {Aspect => 1, WindowWidth => 6});


and the PGPLOT  this:
pgbegin(0,"/GW",1,1);
pgenv(1,10,1,10,0,0);
pglabel('X','Y','My plot');
pgpoint(7,[2..8],[2..8],17);
# etc...
pgend;

So it seems to me that the device cannot be shared and at a first glance, it is 
always a pgplot device but available only to the specific opener.
Am I wrong? It seems quite limiting.


--

Fabio D'Alfonso
'Enabling Business Through IT'
cell.  +39.348.059.40.22 *
web: www.fabiodalfonso.com <http://www.fabiodalfonso.com/>
email: [email protected]
<mailto:[email protected]>linkedin: 
www.linkedin.com/in/fabiodalfonso<http://it.linkedin.com/in/fabiodalfonso>
twitter: 
www.twitter.com/#!/fabio_dalfonso<http://www.twitter.com/#%21/fabio_dalfonso>

fax: +39.06.874.599.581
BlackBerry(r) Wireless Enabled Address.

* Hidden  numbers are automatically rejected by the phone
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to