Figure object have no attribute set_title
18,955
It looks like your stem_graphic
function returns a matplotlib.figure
object, so you should use the suptitle()
method to add a title.
try:
fig, b = stem_graphic(mileage['disp'])
fig.suptitle("Vicky")
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on June 12, 2022Comments
-
Admin about 2 years
I have used
stem_graphic
to plot a stem and leaf plot and saved it to pdf but when trying to enter title its giving error:Figure object have no attribute set_title
.ax, b=stem_graphic(mileage['disp']) ax.set_title("Vicky") This is the error Traceback (most recent call last): File "<pyshell#214>", line 1, in <module> ax.set_title("Vicky") AttributeError: 'Figure' object has no attribute 'set_title'