[Tioga-users] Marker outside plot area
Bill Paxton
paxton at kitp.ucsb.edu
Mon May 19 13:34:06 EDT 2008
Hi Edwin,
On May 19, 2008, at 7:42 AM, Edwin wrote:
> I have a (log-log) plot where I want to plot one point/marker
> slightly outside the main plot area (below the xaxis). Is this
> possible? Alternatively, is it possible to plot the x-axis at any
> location instead of just TOP BOTTOM, AT_Y_ORIGIN?
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.
Concerning your first question: we need to talk about clipping!
Here's the tioga show_plot routine:
def show_plot(bounds=nil,&cmd)
trace_cmd_one_arg(@enter_show_plot_function,
@exit_show_plot_function, bounds) {
set_bounds(bounds)
context { clip_to_frame; cmd.call(self) }
show_plot_box
}
end
The show_plot command argument is called inside a context after first
doing clip_to_frame.
That keeps the plot graphics inside the bounds, which is good. ; - )
Except for cases like yours!
What you'd like to do is (perhaps) temporarily turn off the clipping
so you can write your marker outside of the plot area.
However, in PostScript/PDF there is no way to enlarge a clipping
region; you can only reduce it.
So what might work instead would be something like this:
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
If you decide to give this approach a try, please let me know how it
goes!
Cheers,
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/tioga-users/attachments/20080519/9835f97e/attachment.html>
More information about the Tioga-users
mailing list