<small id='63Cjh'></small><noframes id='63Cjh'>

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

      1. <tfoot id='63Cjh'></tfoot>
        <legend id='63Cjh'><style id='63Cjh'><dir id='63Cjh'><q id='63Cjh'></q></dir></style></legend>

        手动更改 plotly scatterpolar 标签

        Change plotly scatterpolar labels manually(手动更改 plotly scatterpolar 标签)

        <tfoot id='UQYKa'></tfoot>
            <legend id='UQYKa'><style id='UQYKa'><dir id='UQYKa'><q id='UQYKa'></q></dir></style></legend>

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

                  <bdo id='UQYKa'></bdo><ul id='UQYKa'></ul>
                  <i id='UQYKa'><tr id='UQYKa'><dt id='UQYKa'><q id='UQYKa'><span id='UQYKa'><b id='UQYKa'><form id='UQYKa'><ins id='UQYKa'></ins><ul id='UQYKa'></ul><sub id='UQYKa'></sub></form><legend id='UQYKa'></legend><bdo id='UQYKa'><pre id='UQYKa'><center id='UQYKa'></center></pre></bdo></b><th id='UQYKa'></th></span></q></dt></tr></i><div id='UQYKa'><tfoot id='UQYKa'></tfoot><dl id='UQYKa'><fieldset id='UQYKa'></fieldset></dl></div>
                    <tbody id='UQYKa'></tbody>
                  本文介绍了手动更改 plotly scatterpolar 标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个散点图,但外部的标签以度数而不是方向(N、NE、E 等)显示方向.我的数据是度数,所以我需要手动替换图中显示的标签.我当前的代码是:

                  I have a scatterpolar plot, but the labels on the outside show the direction in terms of degrees rather than directions (N, NE, E, etc.). My data is in terms of degrees, so I will need to manually replace the labels shown on the plot. My current code is:

                  import pandas as pd
                  import plotly.graph_objs as go
                  
                  # Get data
                  url = "https://raw.githubusercontent.com/mpudil/projects/master/slc.csv"
                  df = pd.read_csv(url)
                  
                  fig = go.Figure(data=
                      go.Scatterpolar(
                          r = list(df['distance']),
                          theta = list(df['bearing']),
                          mode = 'markers',   
                          name = 'log'
                      ))
                  
                  fig.update_layout(
                      polar = dict(
                        radialaxis = dict(type = "log", tickangle = 45),
                        angularaxis = dict(
                              thetaunit = "degrees",
                              dtick = 45,
                              rotation=90,
                              direction = "clockwise" 
                              )
                      ))
                  
                  

                  这会产生下面的情节.有什么建议可以让情节显示方向而不是度数?谢谢.

                  Which produces the plot below. Any suggestions to make the plot show the direction instead of degree? Thanks.

                  注意:数据可以在 https://github.com 找到/mpudil/projects/blob/master/slc.csv

                  推荐答案

                  不确定是否有更好的方法,但以下应该可以工作

                  Not sure if there is a better way but the following should work

                  fig.update_layout(
                      polar = dict(
                        radialaxis = dict(type = "log", tickangle = 45),
                        angularaxis = dict(
                              thetaunit = "degrees",
                              dtick = 45,
                              rotation=90,
                              direction = "clockwise",
                              tickmode="array",
                              tickvals=[0, 45, 90, 135, 180, 225, 270, 315],
                              ticktext=["N", "NE", "E", "SE", "S", "SW", "W", "NW"]
                              )
                      ))
                  

                  这篇关于手动更改 plotly scatterpolar 标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)

                    1. <legend id='l2Gjk'><style id='l2Gjk'><dir id='l2Gjk'><q id='l2Gjk'></q></dir></style></legend>
                      <tfoot id='l2Gjk'></tfoot>

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

                            <bdo id='l2Gjk'></bdo><ul id='l2Gjk'></ul>

                            <small id='l2Gjk'></small><noframes id='l2Gjk'>