0

I have an issue regarding matplotlib showing my text (pictures below).

enter image description here my code generally is

prop = fm.FontProperties(fname=os.path.join(floc,fn+'.ttf'))
txt='数一数二'
fig=plt.figure('poster', figsize=size, dpi=dpi)
a = fig.add_subplot(111)
a.cla()
plt.setp(a.get_xticklabels(), visible=False)
plt.setp(a.get_xticklines(), visible=False)
plt.setp(a.get_yticklabels(), visible=False)
plt.setp(a.get_yticklines(), visible=False)
plt.subplots_adjust(left=margin/xsize, right=1.0 - margin/xsize, top=1.0 - margin/ysize, bottom=margin/ysize)
plt.text(xd,yd, '\n'.join(txt),size=10, color='white' if fc!='b' else 'black',va='top', fontproperties = prop,clip_on=False)

as this is an animation. But even in still image If I were to show the text it gets cropped. (which I think bases on the width and height of the last script.. Any Ideas how to change this? Thank you

wiziruv
  • 55
  • 6
  • You might try `plt.text(...., clip_on=False)`. Without a reproducible example it is hard to tell what is going on. Does it also happen when you replace the text with English words? – JohanC Nov 02 '20 at 08:35
  • Welcome to Stack Overflow! Please take a moment to read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask). You need to provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) that includes a toy dataset (refer to [How to make good reproducible pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples)) – Diziet Asahi Nov 02 '20 at 09:04
  • Hi, I added my code in the post and the still picture as well. I haven't tried english words though. No database also as this is just text so sample script also provided. – wiziruv Nov 02 '20 at 14:26

0 Answers0