小编Sul*_*rif的帖子

Plotly:如何更改图例中显示的线条的大小?

我很难让传奇在情节上变得更大。我已经用尽了文档、论坛、github 问题,但一无所获。开始思考情节并不是什么伟大的软件。

我创建了这个图表:

在此输入图像描述

我想使试用版 1、试用版 2 和试用版 3 的图例中的线条变大。我可以使用他们的 api 将字体变大,但我没有看到对图例行的引用,现在想知道它是否可能。

这是一些代码:


fig.update_layout(
    title_text="Dipole Moment X (0 V/nm)",
    title_font=dict(size=44, family='Arial'),
    template='simple_white',
    xaxis_tickformat = 'i',
    bargap=0.2, # gap between bars of adjacent location coordinates,
    legend=dict(
        orientation="h",
        yanchor="bottom",
        y=1.02,
        xanchor="right",
        x=1,  
        font = dict(family = "Arial", size = 60),
        bordercolor="LightSteelBlue",
        borderwidth=2,
        itemsizing='trace'
    ),
    legend_title = dict(font = dict(family = "Arial", size = 60)),
)
Run Code Online (Sandbox Code Playgroud)

玩弄了物品大小,也一无所获。有人知道如何实现这一目标吗?

更新

根据下面的答案,我能够使线条变粗,但有一个限制。附上我认为的厚度极限(不知道确切尺寸)

在此输入图像描述

python legend plotly plotly-python

5
推荐指数
1
解决办法
5324
查看次数

Plotly:如何使子图的 x 轴和 y 轴标题更大?

我创建了一个子图,老实说,在情节文档中并不清楚如何使这些标题更大。

\n

https://plotly.com/python-api-reference/ generated/plotly.subplots.make_subplots.html

\n

这是供参考的文档,他们谈论设置 x_axis 标题和 y_axis 标题。我做到了,但我似乎找不到修改它的方法。

\n
\nfig = make_subplots(\n    rows=6, cols=4,\n    subplot_titles=subplot_titles,\n    y_title=\'Distance (\xc3\x85)\',\n    x_title=\'Resid ID\'\n)\n\npositions = [\n                [1, 1], [1, 2], [1, 3], [1, 4],\n                [2, 1], [2, 2], [2, 3], [2, 4],\n                [3, 1], [3, 2], [3, 3], [3, 4],\n                [4, 1], [4, 2], [4, 3], [4, 4],\n                [5, 1], [5, 2], [5, 3], [5, 4],\n                [6, 1], [6, 2], [6, 3], [6, 4],\n            ]\n\n\nfor i in range(0, len(segids)):\n    \n    fig.add_trace(\n        go.Scattergl(\n            x=resid_titles,\n …
Run Code Online (Sandbox Code Playgroud)

python python-3.x plotly plotly-python

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

C++余数在更高的数字处返回7

所以我仍然是编程和尝试学习C++的新手,所以慢慢搞清楚.

现在我正在尝试尝试信用卡号码问题,并尝试隔离数字中的每个数字.

using namespace std;
int main()
{
    int creditcardnumber;
    cout << "Enter a 16-digit credit card number: "; // asks for credit       card number
    cin >> creditcardnumber;
    cin.ignore();
    int d16 = creditcardnumber % 10;

    cout << d16;

} 
Run Code Online (Sandbox Code Playgroud)

在较低的数字像:123456它返回6这是我想要的但是在更高的数字,如:12387128374它返回7我开始注意到它每次在更高的数字时仍然返回7可以任何人解释这个以及如何解决它?

c++

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

标签 统计

plotly ×2

plotly-python ×2

python ×2

c++ ×1

legend ×1

python-3.x ×1