Drawing on a figure, not a subplot

Hello everyone,

I want to use matplotlib to create a figure like the one seen in panel E
of this linked image:

http://www.iovs.org/content/49/12/5425/F1.large.jpg

There are eight 2-D plots shown. All of them display the same two
variables, CD4 on the X-axis and CD3 on the Y-axis. Rather than label
each axis separately, the panel shows single axis labels in the
horizontal and vertical directions, outside of the eight plots. This
reduces clutter and saves space.

I figured out how to place text, using e.g.:

fig = Figure()
external_label = fig.text(x, y, "insert desired text here")

...and then for the Y-axis label,

external_ylabel.set_rotation(90)

Now I would like to add the axis lines and arrows. In fact, I would
prefer a FancyArrow object.

I can see how to add non-text objects to an Axes, e.g.:

ax = fig.add_subplot(111)
ax.add_patch(my_arrow)

But that isn't my goal here. I want to add lines to the FIGURE, outside
of any Axes. Does anyone know how to accomplish this? Thanks!

Not sure what you mean here.
Adding a patch to an axes does not mean it cannot be drawn outside of
axes. As far as you set (or unset) proper clip box, artists can be
drawn anywhere in the canvas regardless of the axes it belongs to.
Here is an example,

Regards,

-JJ

ax = subplot(111)

from matplotlib.patches import FancyArrow
p = FancyArrow(0.05, 0.5, 0.2, 0.0, width=0.01,
               length_includes_head=False,
               head_width=None, head_length=None,
               shape='full', overhang=0,
               head_starts_at_zero=False,
               transform=ax.figure.transFigure,
               clip_on=False)

ax.add_patch(p)

···

On Sat, Sep 17, 2011 at 6:10 AM, John Ladasky <john_ladasky@...209...> wrote:

But that isn't my goal here. I want to add lines to the FIGURE, outside
of any Axes. Does anyone know how to accomplish this? Thanks!

The artist tutorial covers drawing directly to a figure

http://matplotlib.sourceforge.net/users/artists.html#figure-container

I believe you could adapt the patches.FancyArrow to the same approach.

JDH

···

On Fri, Sep 16, 2011 at 4:10 PM, John Ladasky <john_ladasky@...209...> wrote:

Now I would like to add the axis lines and arrows. In fact, I would
prefer a FancyArrow object.

I can see how to add non-text objects to an Axes, e.g.:

ax = fig.add_subplot(111)
ax.add_patch(my_arrow)

But that isn't my goal here. I want to add lines to the FIGURE, outside
of any Axes. Does anyone know how to accomplish this? Thanks!