網(wǎng)站首頁(yè) 編程語言 正文
pyecharts X軸標(biāo)簽太長(zhǎng)被截?cái)?/h2>
方案一
旋轉(zhuǎn)標(biāo)簽
使用rotate旋轉(zhuǎn)X軸標(biāo)簽
# rotate 旋轉(zhuǎn)角度 ??
bar.set_global_opts(xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=-15,interval=0)))
方案二
使用grid設(shè)置X軸下方距離圖片邊緣的距離
grid=Grid(init_opts=opts.InitOpts(width="1600px",height="800px"))
# 設(shè)置距離 bar為x軸標(biāo)簽過長(zhǎng)的柱狀圖?
grid.add(bar,grid_opts=opts.GridOpts(pos_bottom="20%"))?
grid.render("bar.html")
Pyecharts X軸顯示不全問題
成功解決的代碼如下
.set_global_opts(title_opts=opts.TitleOpts(title="xxx"),
? ? ? ? ? ? ? ? ? ? ? ? ? ? xaxis_opts=opts.AxisOpts(name_rotate=60,axislabel_opts={"rotate":45}))
? ? ? ? )
添加
xaxis_opts=pts.AxisOpts(name_rotate=60,axislabel_opts={"rotate":45}))
即可
原文鏈接:https://blog.csdn.net/qq_41248156/article/details/123452027
相關(guān)推薦
- 2023-04-29 Git中使用.gitignore忽略文件的推送方式_相關(guān)技巧
- 2022-06-29 C語言超詳細(xì)講解遞歸算法漢諾塔_C 語言
- 2022-07-26 注冊(cè)bean有多少種方式
- 2022-05-25 spring的構(gòu)造函數(shù)注入屬性@ConstructorBinding
- 2022-09-12 關(guān)于Rsa?Public?Key?not?Find的問題及解決_數(shù)據(jù)庫(kù)其它
- 2022-06-18 Elasticsearch之基本查詢及組合查詢操作示例_其它綜合
- 2023-02-26 C++?ROS與boost:bind()使用詳解_C 語言
- 2022-03-19 基于React?Hooks的小型狀態(tài)管理詳解_React
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支