小编dmb*_*dmb的帖子

调整散景图的标题字体大小

使用散景时,如何设置图形的标题字体大小?

我试过(在ipython笔记本中):

import bokeh.plotting as bp
import numpy as np
bp.output_notebook()

x_points = np.random.rand(100)
y_points = np.random.rand(100)

bp.figure(title='My Title', x_axis_label='X axis', y_axis_label='Y axis', \
    text_font_size='8pt')

bp.scatter(x_points, y_points)
bp.show()
Run Code Online (Sandbox Code Playgroud)

我已经尝试过text_font_size,label_text_font,title_font_size等.文档中的所有信息都在哪里?

python bokeh

12
推荐指数
2
解决办法
9247
查看次数

函数返回元组而不是字符串

我在python中有一个类似于以下的函数:

def checkargs(*args):
    if len(args) == 1:
        x = args
        y = something
    elif len(args) == 2:
        x, y = args

    return x, y
Run Code Online (Sandbox Code Playgroud)

当我只输入一个参数(一个字符串)时,x作为一个元组出现.当我输入两个参数(两个字符串)时,x和y作为字符串返回.如果我只输入一个参数,我怎么能把x作为字符串出来?

python string tuples function python-2.7

2
推荐指数
1
解决办法
1175
查看次数

标签 统计

python ×2

bokeh ×1

function ×1

python-2.7 ×1

string ×1

tuples ×1