I'm trying to set up a chart that shows a runtime trace of a single frame.
Most of it is straight forward, however one aspect of it is driving me
crazy. I would like to label the inside of the bar fragments (each represent
a function call with the x-extent being its runtime) with the name of the
task, however I would like the text itself to be fully contained within the
bar itself. I should, in theory, be able to set the clipping box of the text
to be the bounding box of the bar and that should give me the result I want.
Except, I'm not getting that. 

Any ideas?

See the code below:

import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
rect = ax.barh(10, 50, 3, facecolor='green', visible=True)
ax.set_ylim(0,35)
ax.set_xlim(0,1000)

text0 = ax.text(0,11,'JobName',clip_on=True,clip_box=rect[0].get_bbox())

ax.grid(True)

plt.show()

-- 
View this message in context: 
http://old.nabble.com/Clip-text-in-bars-tp28693489p28693489.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to