Hi,

I'm trying to draw a box around an axes title, and I'm having trouble
controlling it. I want the box to span the width of the x axis. I
tried some iterations on the below since xy and height/width are
hard-coded in set_title, but when I call show, it seems the width of
the box is reset. Any ideas? Thanks,

Skipper

import matplotlib as mpl
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111, axisbg='lightgrey')

ax.set_ylim(-0.05,1.05)
ax.set_xlim(-0.5,9.5)

rd = np.random.dirichlet(np.ones(10))
ax.plot(np.arange(10), rd, 'bo', markersize=5)
ax.vlines(np.arange(10), 0 ,rd, color='b')

title_box = dict(boxstyle = "Round", fc='gray', ec='black')
ax.set_title("1", bbox = title_box, x=0, y=1)
bbox = ax.title._bbox_patch
bbox.update(dict(width=25.))

fig.suptitle("Dirichlet(1) Draw", fontsize=36)
fig.subplots_adjust(top=.85)

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to