plotly / plotly/plotly.R

Why tickvals/ticktext is not showing on x-axis in population pyramid graph

未关闭
#1,955 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
R
星标
2.7k
派生
641
PR 合并指标
30 天内没有已合并 PR

描述

Creating instance of the figure

fig = gp.Figure()

Adding Male data to the figure

fig.add_trace(gp.Bar(y= y_age, x = x_M,
name = 'Male', orientation = 'h'))

Adding Female data to the figure

fig.add_trace(gp.Bar(y = y_age, x = x_F,
name = 'Female', orientation = 'h'))

Updating the layout for our graph

fig.update_layout(title = 'Population Pyramid of Registration Data',
title_font_size = 22, barmode = 'relative',
bargap = 0.6, bargroupgap = 0,
xaxis = dict(tickvals = [-1000, -800, -600, -400, -200, 0, 200, 400, 600, 800, 1000],

						                 ticktext = ['10H', '8H',  '6H', '4H', '2H', 
                                        '0', '2H', '4H', '6H', '8H', '10H'],
							
						                 title = 'Population in Hundreds',
						                 title_font_size = 12)
		       	   )

fig.show()

image
PP graph.docx

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用提供的 R 人口金字塔示例复现该问题,尤其检查 xaxis、tickvals 和 ticktext 设置,并检查 fig.show() 附近的行为。确认配置的标签是否显示在 x 轴上;完成的标准是示例正确渲染所请求的刻度标签,或记录该限制及其原因。

由索引模型根据 Issue 内容生成。

评估

技术栈
r
领域
data-visualization
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。