subplots and text?

Hello,
I just discovered matplotlib (and python).
I got things running pretty fast/easily (thx to the good documentation)
but I got a problem with texts and subplots.

-text tend to overlap previous subplots. this is more annoying than a real issue ... but still, It looks blatantly dirty... I had no success with zorder

-text overlaps, is there a way to "automagically place" text so that overlapping is minimal?
taking into account that my text labels are only constrained on X and can be moved freely on Y
I would happily get the boundaries of the text labels and sort my x/y coordinates myself, but I couldn't find such boundaries.

for the record: I'm plotting some system datas (like cpu/ram/disk usage) over time and placing dbus calls over that
at the moment, I got 5 subplots vertically arranged sharing the same x axis
I represent dbus calls with axvlines and annotate them with some dbus infos (usually 15 chars)

thx for your time, and the nice piece of software :slight_smile:

···

----
This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you.

Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
----

Matplotlib doesn’t have the ability to automatically space out the text. You can force your subplots to be further apart (and leave room for more text) using the pyplot.subplots_adjust command.

Ryan

···

On Fri, Apr 24, 2009 at 8:41 AM, granquet <granquet@…2572…> wrote:

Hello,

I just discovered matplotlib (and python).

I got things running pretty fast/easily (thx to the good documentation)

but I got a problem with texts and subplots.

-text tend to overlap previous subplots. this is more annoying than a

real issue … but still, It looks blatantly dirty… I had no success

with zorder

-text overlaps, is there a way to “automagically place” text so that

overlapping is minimal?

taking into account that my text labels are only constrained on X and

can be moved freely on Y

I would happily get the boundaries of the text labels and sort my x/y

coordinates myself, but I couldn’t find such boundaries.

for the record: I’m plotting some system datas (like cpu/ram/disk usage)

over time and placing dbus calls over that

at the moment, I got 5 subplots vertically arranged sharing the same x axis

I represent dbus calls with axvlines and annotate them with some dbus

infos (usually 15 chars)


Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Ryan May wrote:

    Hello,
    I just discovered matplotlib (and python).
    I got things running pretty fast/easily (thx to the good
    documentation)
    but I got a problem with texts and subplots.

    -text tend to overlap previous subplots. this is more annoying than a
    real issue ... but still, It looks blatantly dirty... I had no success
    with zorder

    -text overlaps, is there a way to "automagically place" text so that
    overlapping is minimal?
    taking into account that my text labels are only constrained on X and
    can be moved freely on Y
    I would happily get the boundaries of the text labels and sort my x/y
    coordinates myself, but I couldn't find such boundaries.

    for the record: I'm plotting some system datas (like cpu/ram/disk
    usage)
    over time and placing dbus calls over that
    at the moment, I got 5 subplots vertically arranged sharing the
    same x axis
    I represent dbus calls with axvlines and annotate them with some dbus
    infos (usually 15 chars)

Matplotlib doesn't have the ability to automatically space out the text. You can force your subplots to be further apart (and leave room for more text) using the pyplot.subplots_adjust command.

Ryan

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

alright, so I'll have to do it on my own! any hints on where to start?
for the moment I'll forget the problem with overlapping text on subplots, I gotta fix the plotted texts overlaped in the same subplot.

I intend to get the bbox of the text, and adjust the next plotted text y value with an offset equals the height of the bounding box.
it seems feasable.

but I need some feedback, is that the good way? are the bounding boxe sizes relative to figure size or absolute (axis values, ie: dependant of scaling/zooming)?

has anyone ever done that (or similar)?

Guillaume Ranquet.

···

On Fri, Apr 24, 2009 at 8:41 AM, granquet <granquet@…2572… > <mailto:granquet@…2572…>> wrote:

----
This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you.

Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
----