带袖扣的情节的轴标题

发布于 2025-01-22 17:29:58 字数 550 浏览 4 评论 0原文

我正在尝试使用袖扣来板条板块数据框的表面图。

我想拥有自定义的轴标题(title_1title_2title_3)和带有数学符号的绘图标题。但是,我得到的情节不会显示我的轴标题,在绘图标题中,我只看到数学符号,而不是“我的标题”。为什么它不起作用以及如何解决?

我正在jupyter笔记本上工作。

import cufflinks as cf
cf.set_config_file(offline=True, dimensions=((1000,600)), theme = 'white')
pd.DataFrame([(1,2),(3,4)]).iplot(kind = 'surface', xTitle = "title_1", \
                              yTitle = "title_2" , zTitle = "title_3",\
                              title = r"My title with $\sigma$")

I am trying to crate a surface plot of a pandas DataFrame using cufflinks.

I would like to have customized axes titles (title_1,title_2 and title_3) and a plot title with a math symbol. However the plot I get does not display my axes titles and in the plot title I only see the math symbol but not "My title with ". Why it does not work and how to fix it?

I am working in a Jupyter notebook.

import cufflinks as cf
cf.set_config_file(offline=True, dimensions=((1000,600)), theme = 'white')
pd.DataFrame([(1,2),(3,4)]).iplot(kind = 'surface', xTitle = "title_1", \
                              yTitle = "title_2" , zTitle = "title_3",\
                              title = r"My title with $\sigma
quot;)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长安忆 2025-01-29 17:29:58

由于iplot返回一个情节图,因此您可以提供一个布局对象,如下(请参阅绘图文档以了解布局的工作原理):

import cufflinks as cf
cf.set_config_file(offline=True, dimensions=((1000,600)), theme = 'white')
pd.DataFrame([(1,2),(3,4)]).iplot(
    kind = 'surface',
    layout = {
        "scene": {
            "xaxis": {"title": "x axis"},
            "yaxis": {"title": "y axis"},
            "zaxis": {"title": "z axis"},
        },
        "title": r"My title with $\sigma$"
    })

vizug.png“ rel =” nofollow noreferrer“>

Since iplot returns a Plotly figure, you can provide a layout object, as follow (refer to Plotly documentation to understand how layout works):

import cufflinks as cf
cf.set_config_file(offline=True, dimensions=((1000,600)), theme = 'white')
pd.DataFrame([(1,2),(3,4)]).iplot(
    kind = 'surface',
    layout = {
        "scene": {
            "xaxis": {"title": "x axis"},
            "yaxis": {"title": "y axis"},
            "zaxis": {"title": "z axis"},
        },
        "title": r"My title with $\sigma
quot;
    })

enter image description here

As for why in the title you only see the rendered sigma and not the text, that is a bug with Plotly. Nothing we can do about it, for now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文