V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Nagase
V2EX  ›  Python

关于 matplotlib 中文本的字体大小的问题

  •  
  •   Nagase · 2019-09-18 09:02:54 +08:00 · 2734 次点击
    这是一个创建于 1676 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想问下 ax.test 的文字大小最小能是多少,我使用 fontsize 用的 0.1,但是对于我来说还是大了

    ![F8I_1X44J]B4@2X`8DJX}5S.png]( http://ww1.sinaimg.cn/large/005GDBl4gy1g73e6ix8qxj30fh0bmwej.jpg)

    10 条回复    2019-09-18 12:29:12 +08:00
    Nagase
        1
    Nagase  
    OP
       2019-09-18 09:03:18 +08:00
    ![F8I_1X44J]B4@2X`8DJX}5S.png]( )
    SeaRecluse
        2
    SeaRecluse  
       2019-09-18 09:11:59 +08:00
    画图的话纵轴的具体数据没必要表示出来啊,一定需要表示的话,用备注的方式标在图上或者你自己设定纵轴的具体间隔,不然那太难看了
    Nagase
        3
    Nagase  
    OP
       2019-09-18 09:14:19 +08:00
    @SeaRecluse 需求就是要在纵轴下面写上数据,每个都要写,而且间隔不确定的,所以想着说字体大小能不能再改小一点
    CoucheLimite
        4
    CoucheLimite  
       2019-09-18 09:36:26 +08:00
    如果字体不能再改小,可以把图的尺寸改大一点吗?
    necomancer
        5
    necomancer  
       2019-09-18 09:43:50 +08:00
    把图放大。
    Nagase
        6
    Nagase  
    OP
       2019-09-18 09:52:57 +08:00
    @necomancer
    @CoucheLimite
    是设置 dpi 吗,我 dpi 已经到 2000 了
    Tony042
        7
    Tony042  
       2019-09-18 10:04:38 +08:00   ❤️ 1
    figure.set_figuresize 我记得命令大概长这样,具体还得楼主查下
    Nagase
        8
    Nagase  
    OP
       2019-09-18 10:28:23 +08:00
    @Tony042
    plt.figure(figsize=(, ))
    试了几个搭配找到了最合适的那个,谢谢
    jdhao
        9
    jdhao  
       2019-09-18 10:33:17 +08:00
    7 楼正解,把图片的高度变大,y 轴的 ticklabel 应该就能分开了
    necomancer
        10
    necomancer  
       2019-09-18 12:29:12 +08:00
    @Nagase figsize,比如在新建图的时候用 fig = plt.figure(figsize=(50,50))
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2902 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 07:35 · PVG 15:35 · LAX 00:35 · JFK 03:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.