[Tioga-users] Marker outside plot area

Edwin edder at tkwsping.nl
Mon May 19 13:57:46 EDT 2008


On Mon, 19 May 2008 18:34:06 +0100, Bill Paxton <paxton at kitp.ucsb.edu>  
wrote:

> Thanks to Vincent, you should be able to put the x-axis anywhere you'd  
> like.  Since he knows > more about it that I do, I'm going to let him  
> provide the details.

Is this already possible in the current version of tioga? It was not  
mentioned at all in the documentation that I could find.

>     def my_show_plot(bounds=nil,&cmd)
>         my_enter_show_plot_function(bounds)
>         set_bounds(bounds)
>         context { clip_to_frame; cmd.call(self) }
>         context { my_unclipped_stuff }
>         show_plot_box
>         my_exit_show_plot_function (bounds)
>     end

 From reading the documentation I already gathered it had something to do  
with clip_to_frame, but was kinda afraid that show_plot would turn out to  
be quite complicated. Luckily, it is quite simple and easy to follow :) I  
ended up just doing the whole thing without clip_to_frame, by rewriting:

t.show_plot( mybounds ) do
	...
end

to:

cmd = Proc.new do
	...
end
t.set_bounds( mybounds )
t.context { cmd.call( self ) }
t.show_plot_box

That worked perfectly. (I think I am now calling cmd with another "self",  
but since I am not using it within the block anyway that does not matter  
in this case.)

Cheers,

Edwin



More information about the Tioga-users mailing list