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.
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)
text0 = ax.text(0,11,'JobName',clip_on=True,clip_box=rect.get_bbox())
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.