[Matplotlib-users] Help: How to limit text to a definite area

2008-09-10 Thread Samir Wadhawan
Hi,

I am trying to draw a rectangle of a fixed size and them put a lable/text on
it. However if the text is too long, it goes out of bounds. Is there a way I
restrict the text within the rectangle margins.

heres what I am using
##
 def  rectangle(self, lower, upper, node1, branch_name):
rect = Rectangle(lower, upper[0]-lower[0], upper[1] - lower[1],
   edgecolor='k',
   facecolor= self.color_method(node1))

   self.ax.add_patch(rect)
   self.ax.text(lower[0] + (upper[0]-lower[0])/2, lower[1] +
(upper[1]-lower[1])/2, branch_name, ha='left', va='center',
fontsize='xx-small')

Any thoughts / suggestion will be really appreciated.

Thanks

samir
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Cell and auto_set_font_size() question

2008-09-16 Thread Samir Wadhawan
Hi,

I am new to Python and trying to use Cell and its method
auto_set_font_size()

here is the code
"
def draw_Cell(self, lower, upper, node1, branch_name):


c = Cell(lower, upper[0]-lower[0], upper[1] - lower[1],
   edgecolor='k', text = branch_name,
   facecolor= self.color_method(node1), loc = None)

self.ax.add_patch(c)

"
My question is how do I use the method 'auto_set_font_size()' to shrink font
size to fit the text.

Thanks

Samir
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users