plot.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:jvcprojectortools 作者: arvehj 项目源码 文件源码
def label_pos(self, pos, label=None, horizontal=False):
        """Calculate label start position (top-right if vertical, top-center if horizontal)"""
        xscale = turtle.getscreen().xscale
        yscale = turtle.getscreen().yscale
        font_family, font_size = self.font
        font = Font(family=font_family, size=font_size)
        line_height = font.metrics('linespace') / yscale
        height = (label.count('\n') + 1) * line_height
        return -8 / xscale if horizontal else pos, \
               pos - 0.5 * height if horizontal else -height - 6 / yscale
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号