Hmm, I see. Another option is NOT to use the nxpanel
and just use the PlotPosition

Example attached

 Xavier


On 2/27/07, Robert Cumming <[EMAIL PROTECTED]> wrote:
In article <[EMAIL PROTECTED]>,
"Xavier Calbet" <[EMAIL PROTECTED]> wrote:
>   I have just added another recipe in the CookBook,
> have a look and see if it is of any help.
>
> 
http://wiki.jach.hawaii.edu/pdl_wiki-bin/wiki/How_to_plot_graphs_with_two_different_pairs_of_axis_on_the_same_plot
>
>   Any comments appreciated.

Nice.  But if I add panels according to

$w=PDL::Graphics::PGPLOT::Window->new(Device=>"/XSERVE",nxpanel=>4,nypanel=>3);

then the superposed plot always ends up in the bottom right panel.  If
I then comment out the PlotPosition arguments then the two
(unsuperposed) plots land as expected in the first two panels at the
top left.

I don't see why this should be so!

/Robert


> On 2/27/07, Robert Cumming <[EMAIL PROTECTED]> wrote:
>> In article <[EMAIL PROTECTED]>,
>> Rahman Amanullah <[EMAIL PROTECTED]> wrote:
>> > you can solve this by passing the an array ref with the PlotPosition
>> > option to env. For example
>> >   env(0,1,0,1,{PlotPosition=>[0.1,0.9,0.1,0.5]});
>> >   points(...)
>> >   env(0,1,0,1,{PlotPosition=>[0.1,0.9,0.5,0.9]});
>> >   lines(...)
>>
>> That works nicely for each plot, but now all my panels get drawn on
>> top of one another.  In the last panel position, what's more.
>>
>> I've tried putting in a release() after each env-points-etc block, but
>> that seems to have no effect.

--
Robert Cumming, Stockholms observatorium
http://www.astro.su.se/

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

#!/usr/bin/env perl
 
 use PDL;
 use PDL::Graphics::PGPLOT::Window;
 use PGPLOT;
 
 # Generate dataset
 $x=zeroes(100)->xlinvals(-10,10);
 $y=$x**2;
 $z=100*cos($x);
 
 # Open device
 $w=PDL::Graphics::PGPLOT::Window->new(Device=>'/xserve');
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.1,0.3,0.1,0.36666],
					  Axis=>['BNST','BNST'],
					  XTitle=>'x',
					  YTitle=>'y',
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.1,0.3,0.1,0.3666],
 				     Axis=>['CST','CST'],
 				     Color=>'red'});
 
 pgsci(2);
 #pgmtext('T',2.5,0.5,0.5,'x');
 #pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});

 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.3,0.5,0.1,0.36666],
					  Axis=>['BNST','BST'],
					  XTitle=>'x',
					  #YTitle=>'y',
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.3,0.5,0.1,0.3666],
 				     Axis=>['CST','CST'],
 				     Color=>'red'});
 
 pgsci(2);
 #pgmtext('T',2.5,0.5,0.5,'x');
 #pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.5,0.7,0.1,0.36666],
					  Axis=>['BNST','BST'],
					  XTitle=>'x',
					  #YTitle=>'y',
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.5,0.7,0.1,0.3666],
 				     Axis=>['CST','CST'],
 				     Color=>'red'});
 
 pgsci(2);
 #pgmtext('T',2.5,0.5,0.5,'x');
 #pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
 # Plot first graph with axis
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.7,0.9,0.1,0.36666],
					  Axis=>['BNST','BST'],
					  XTitle=>'x',
					  #YTitle=>'y',
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.7,0.9,0.1,0.3666],
 				     Axis=>['CST','MCST'],
 				     Color=>'red'});
 
 pgsci(2);
 #pgmtext('T',2.5,0.5,0.5,'x');
 pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});


################## Second row ####################################
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.1,0.3,0.36666,0.63333],
					  Axis=>['BST','BNST'],
					  #XTitle=>'x',
					  YTitle=>'y',
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.1,0.3,0.36666,0.63333],
 				     Axis=>['CST','CST'],
 				     Color=>'red'});
 
 pgsci(2);
 #pgmtext('T',2.5,0.5,0.5,'x');
 #pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.3,0.5,0.36666,0.63333],
					  #XTitle=>'x',
					  #YTitle=>'y',
					  Axis=>['BST','BST'],
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.3,0.5,0.36666,0.63333],
 				     Axis=>['CST','CST'],
 				     Color=>'red'});
 
 pgsci(2);
 #pgmtext('T',2.5,0.5,0.5,'x');
 #pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.5,0.7,0.36666,0.63333],
					  #XTitle=>'x',
					  #YTitle=>'y',
					  Axis=>['BST','BST'],
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.5,0.7,0.36666,0.63333],
 				     Axis=>['CST','CST'],
 				     Color=>'red'});
 
 pgsci(2);
 #pgmtext('T',2.5,0.5,0.5,'x');
 #pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.7,0.9,0.36666,0.63333],
					  #XTitle=>'x',
					  #YTitle=>'y',
					  Axis=>['BST','BST'],
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.7,0.9,0.36666,0.63333],
 				     Axis=>['CST','CMST'],
 				     Color=>'red'});
 
 pgsci(2);
 #pgmtext('T',2.5,0.5,0.5,'x');
 pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
################## Third row ####################################
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.1,0.3,0.63333,0.89999],
					  Axis=>['BST','BNST'],
					  #XTitle=>'x',
					  YTitle=>'y',
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.1,0.3,0.63333,0.89999],
 				     Axis=>['CMST','CST'],
 				     Color=>'red'});
 
 pgsci(2);
 pgmtext('T',2.5,0.5,0.5,'x');
 #pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.3,0.5,0.63333,0.89999],
					  #XTitle=>'x',
					  #YTitle=>'y',
					  Axis=>['BST','BST'],
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.3,0.5,0.63333,0.89999],
 				     Axis=>['CMST','CST'],
 				     Color=>'red'});
 
 pgsci(2);
 pgmtext('T',2.5,0.5,0.5,'x');
 #pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.5,0.7,0.63333,0.89999],
					  #XTitle=>'x',
					  #YTitle=>'y',
					  Axis=>['BST','BST'],
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.5,0.7,0.63333,0.89999],
 				     Axis=>['CMST','CST'],
 				     Color=>'red'});
 
 pgsci(2);
 pgmtext('T',2.5,0.5,0.5,'x');
 #pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
 
 # Plot first graph with axis
 $w->env(min($x),max($x),min($y),max($y),{PlotPosition=>[0.7,0.9,0.63333,0.89999],
					  #XTitle=>'x',
					  #YTitle=>'y',
					  Axis=>['BST','BST'],
					  Color=>'blue'});
 $w->line($x,$y,{Color=>'blue'});
 
 #Plot second graph with axis
 $w->env(min($x),max($x),min($z),max($z),{PlotPosition=>[0.7,0.9,0.63333,0.89999],
 				     Axis=>['CMST','CMST'],
 				     Color=>'red'});
 
 pgsci(2);
 pgmtext('T',2.5,0.5,0.5,'x');
 pgmtext('R',2.5,0.5,0.5,'z');
 $w->line($x,$z,{Color=>'red'});
 
 
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to