• <small id='goXcw'></small><noframes id='goXcw'>

  • <legend id='goXcw'><style id='goXcw'><dir id='goXcw'><q id='goXcw'></q></dir></style></legend>

      • <bdo id='goXcw'></bdo><ul id='goXcw'></ul>
    1. <i id='goXcw'><tr id='goXcw'><dt id='goXcw'><q id='goXcw'><span id='goXcw'><b id='goXcw'><form id='goXcw'><ins id='goXcw'></ins><ul id='goXcw'></ul><sub id='goXcw'></sub></form><legend id='goXcw'></legend><bdo id='goXcw'><pre id='goXcw'><center id='goXcw'></center></pre></bdo></b><th id='goXcw'></th></span></q></dt></tr></i><div id='goXcw'><tfoot id='goXcw'></tfoot><dl id='goXcw'><fieldset id='goXcw'></fieldset></dl></div>
      <tfoot id='goXcw'></tfoot>

        情节:情节表达遵循什么颜色循环?

        时间:2023-09-29
          <tfoot id='2odrp'></tfoot>

          • <small id='2odrp'></small><noframes id='2odrp'>

            <legend id='2odrp'><style id='2odrp'><dir id='2odrp'><q id='2odrp'></q></dir></style></legend>
            <i id='2odrp'><tr id='2odrp'><dt id='2odrp'><q id='2odrp'><span id='2odrp'><b id='2odrp'><form id='2odrp'><ins id='2odrp'></ins><ul id='2odrp'></ul><sub id='2odrp'></sub></form><legend id='2odrp'></legend><bdo id='2odrp'><pre id='2odrp'><center id='2odrp'></center></pre></bdo></b><th id='2odrp'></th></span></q></dt></tr></i><div id='2odrp'><tfoot id='2odrp'></tfoot><dl id='2odrp'><fieldset id='2odrp'></fieldset></dl></div>
              • <bdo id='2odrp'></bdo><ul id='2odrp'></ul>

                    <tbody id='2odrp'></tbody>
                1. 本文介绍了情节:情节表达遵循什么颜色循环?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我认为默认颜色循环将是(一些变体)['blue', 'red', 'green', 'purple', 'orange'] 就像在情节下面:

                  I would think that the default color cycle would be (some variants of) ['blue', 'red', 'green', 'purple', 'orange'] like in the plot below:

                  情节 1:

                  代码 1:

                  import plotly
                  import plotly.express as px
                  
                  gapminder = px.data.gapminder()
                  gapminder2007=gapminder.query("year==2007")
                  px.scatter(gapminder2007, x='gdpPercap', y='lifeExp', color="continent")
                  

                  至少 似乎 是循环的顺序,因为从大陆省略 Oceania 会给你这个:

                  At least that seems to be the order of the cycle since omitting Oceania from the continents will give you this:

                  现在剩下的颜色的顺序是一样的,除了最后一个橙色的(只是表明颜色的应用不是任意的).

                  Now the order of the remaining colors are the same except for the last orange looking one (just showing that the application of the colors are not aribtrary).

                  我认为这可以使用 plotly.colors.DEFAULT_PLOTLY_COLORS 进行检索,这将为您提供:

                  I thought this would be possibleto retrieve using plotly.colors.DEFAULT_PLOTLY_COLORS which will give you:

                  ['rgb(31, 119, 180)',
                   'rgb(255, 127, 14)',
                   'rgb(44, 160, 44)',
                   'rgb(214, 39, 40)',
                   'rgb(148, 103, 189)',
                   'rgb(140, 86, 75)',
                   'rgb(227, 119, 194)',
                   'rgb(127, 127, 127)',
                   'rgb(188, 189, 34)',
                   'rgb(23, 190, 207)']
                  

                  但是这些颜色的顺序类似于 ['blue', 'orange', 'green', 'red']...

                  But those colors are ordered like ['blue', 'orange', 'green', 'red']...

                  那么,在 px.scatter(gapminder2007, x='gdpPercap',y='lifeExp', color="continent")?

                  我也尝试在 help(px.colors) 下查看,但这并没有提供太多帮助:

                  I tried looking under help(px.colors) too, but that didn't give much:

                  关于 plotly.express 中的模块 plotly.express.colors 的帮助:

                  Help on module plotly.express.colors in plotly.express:

                  名字plotly.express.colors

                  NAME plotly.express.colors

                  数据DEFAULT_PLOTLY_COLORS = ['rgb(31, 119, 180)', 'rgb(255, 127, 14)', 'rg...PLOTLY_SCALES = {'Blackbody': [[0, 'rgb(0,0,0)'], [0.2, 'rgb(230,0,0)'...absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0...

                  DATA DEFAULT_PLOTLY_COLORS = ['rgb(31, 119, 180)', 'rgb(255, 127, 14)', 'rg... PLOTLY_SCALES = {'Blackbody': [[0, 'rgb(0,0,0)'], [0.2, 'rgb(230,0,0)'... absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0...

                  推荐答案

                  此文档页面涵盖离散颜色序列:https://plot.ly/python/discrete-color/ 并提到默认序列来自活动模板中的 layout.colorway.

                  This doc page covers discrete color sequences: https://plot.ly/python/discrete-color/ and mentions that the default sequence comes from layout.colorway in the active template.

                  在名为 plotly 的默认模板中,这是 px.colors.qualitative.Plotly 下可用的序列.

                  In the default template called plotly this is the sequence available under px.colors.qualitative.Plotly.

                  这个序列是['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880','#FF97FF', '#FECB52']

                  这篇关于情节:情节表达遵循什么颜色循环?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何将情节表达图保存到 html 或静态图像文件中? 下一篇:python将绘图保存到本地文件并插入到html中

                  相关文章

                  <tfoot id='sE1U9'></tfoot>
                2. <legend id='sE1U9'><style id='sE1U9'><dir id='sE1U9'><q id='sE1U9'></q></dir></style></legend>

                  <i id='sE1U9'><tr id='sE1U9'><dt id='sE1U9'><q id='sE1U9'><span id='sE1U9'><b id='sE1U9'><form id='sE1U9'><ins id='sE1U9'></ins><ul id='sE1U9'></ul><sub id='sE1U9'></sub></form><legend id='sE1U9'></legend><bdo id='sE1U9'><pre id='sE1U9'><center id='sE1U9'></center></pre></bdo></b><th id='sE1U9'></th></span></q></dt></tr></i><div id='sE1U9'><tfoot id='sE1U9'></tfoot><dl id='sE1U9'><fieldset id='sE1U9'></fieldset></dl></div>
                      <bdo id='sE1U9'></bdo><ul id='sE1U9'></ul>

                    1. <small id='sE1U9'></small><noframes id='sE1U9'>