pycharm制作柱状图
Bar - Bar_rotate_xaxis_label
解决标签名字过长的问题
from pyecharts import options as opts
from pyecharts.charts import Barc = (Bar().add_xaxis(["高等数学1,2","C语言程序设计","python程序设计","大数据导论","数据结构","大数据与人工智能",]).add_yaxis("大一的学习效率", [10, 20, 30, 40, 50, 40]).add_yaxis("大二的学习效率", [20, 10, 40, 30, 40, 50]).set_global_opts(xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=-15)), #此行代码旋转标签的角度title_opts=opts.TitleOpts(title="信阳农林学院信息工程学院", subtitle="数据科学与大数据技术21-2"),).render("bar_rotate_xaxis_label.html")
)
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"><title>Awesome-pyecharts</title><script type="text/javascript" src="https://assets.pyecharts.org/assets/v5/echarts.min.js"></script></head>
<body ><div id="8601599b79914f0cb28546e9b9a362e3" class="chart-container" style="width:900px; height:500px; "></div><script>var chart_8601599b79914f0cb28546e9b9a362e3 = echarts.init(document.getElementById('8601599b79914f0cb28546e9b9a362e3'), 'white', {renderer: 'canvas'});var option_8601599b79914f0cb28546e9b9a362e3 = {"animation": true,"animationThreshold": 2000,"animationDuration": 1000,"animationEasing": "cubicOut","animationDelay": 0,"animationDurationUpdate": 300,"animationEasingUpdate": "cubicOut","animationDelayUpdate": 0,"aria": {"enabled": false},"color": ["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"series": [{"type": "bar","name": "\u5927\u4e00\u7684\u5b66\u4e60\u6548\u7387","legendHoverLink": true,"data": [10,20,30,40,50,40],"realtimeSort": false,"showBackground": false,"stackStrategy": "samesign","cursor": "pointer","barMinHeight": 0,"barCategoryGap": "20%","barGap": "30%","large": false,"largeThreshold": 400,"seriesLayoutBy": "column","datasetIndex": 0,"clip": true,"zlevel": 0,"z": 2,"label": {"show": true,"margin": 8}},{"type": "bar","name": "\u5927\u4e8c\u7684\u5b66\u4e60\u6548\u7387","legendHoverLink": true,"data": [20,10,40,30,40,50],"realtimeSort": false,"showBackground": false,"stackStrategy": "samesign","cursor": "pointer","barMinHeight": 0,"barCategoryGap": "20%","barGap": "30%","large": false,"largeThreshold": 400,"seriesLayoutBy": "column","datasetIndex": 0,"clip": true,"zlevel": 0,"z": 2,"label": {"show": true,"margin": 8}}],"legend": [{"data": ["\u5927\u4e00\u7684\u5b66\u4e60\u6548\u7387","\u5927\u4e8c\u7684\u5b66\u4e60\u6548\u7387"],"selected": {},"show": true,"padding": 5,"itemGap": 10,"itemWidth": 25,"itemHeight": 14,"backgroundColor": "transparent","borderColor": "#ccc","borderWidth": 1,"borderRadius": 0,"pageButtonItemGap": 5,"pageButtonPosition": "end","pageFormatter": "{current}/{total}","pageIconColor": "#2f4554","pageIconInactiveColor": "#aaa","pageIconSize": 15,"animationDurationUpdate": 800,"selector": false,"selectorPosition": "auto","selectorItemGap": 7,"selectorButtonGap": 10}],"tooltip": {"show": true,"trigger": "item","triggerOn": "mousemove|click","axisPointer": {"type": "line"},"showContent": true,"alwaysShowContent": false,"showDelay": 0,"hideDelay": 100,"enterable": false,"confine": false,"appendToBody": false,"transitionDuration": 0.4,"textStyle": {"fontSize": 14},"borderWidth": 0,"padding": 5,"order": "seriesAsc"},"xAxis": [{"show": true,"scale": false,"nameLocation": "end","nameGap": 15,"gridIndex": 0,"axisLabel": {"show": true,"rotate": -15,"margin": 8},"inverse": false,"offset": 0,"splitNumber": 5,"minInterval": 0,"splitLine": {"show": true,"lineStyle": {"show": true,"width": 1,"opacity": 1,"curveness": 0,"type": "solid"}},"data": ["\u9ad8\u7b49\u6570\u5b661\uff0c2","C\u8bed\u8a00\u7a0b\u5e8f\u8bbe\u8ba1","python\u7a0b\u5e8f\u8bbe\u8ba1","\u5927\u6570\u636e\u5bfc\u8bba","\u6570\u636e\u7ed3\u6784","\u5927\u6570\u636e\u4e0e\u4eba\u5de5\u667a\u80fd"]}],"yAxis": [{"show": true,"scale": false,"nameLocation": "end","nameGap": 15,"gridIndex": 0,"inverse": false,"offset": 0,"splitNumber": 5,"minInterval": 0,"splitLine": {"show": true,"lineStyle": {"show": true,"width": 1,"opacity": 1,"curveness": 0,"type": "solid"}}}],"title": [{"show": true,"text": "\u4fe1\u9633\u519c\u6797\u5b66\u9662\u4fe1\u606f\u5de5\u7a0b\u5b66\u9662","target": "blank","subtext": "\u6570\u636e\u79d1\u5b66\u4e0e\u5927\u6570\u636e\u6280\u672f21-2","subtarget": "blank","padding": 5,"itemGap": 10,"textAlign": "auto","textVerticalAlign": "auto","triggerEvent": false}]
};chart_8601599b79914f0cb28546e9b9a362e3.setOption(option_8601599b79914f0cb28546e9b9a362e3);</script>
</body>
</html>

Bar - Bar_stack0
叠层柱状图
可以求比例
from pyecharts import options as opts
from pyecharts.charts import Bar
from pyecharts.faker import Fakerc = (Bar().add_xaxis(["高等数学1,2","C语言程序设计","python程序设计","大数据导论","数据结构","大数据与人工智能",]).add_yaxis("大一的学习效率", [10, 20, 30, 40, 50, 40],stack="stack1") # stack="stack1" 表示同一列.add_yaxis("大二的学习效率", [20, 30, 50, 60, 70, 80],stack="stack1") #.set_series_opts(label_opts=opts.LabelOpts(is_show=False)).set_global_opts(xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=-15)),title_opts=opts.TitleOpts(title="信息工程学院学习知识所占百分比")).render("bar_stack0.html")
)
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"><title>Awesome-pyecharts</title><script type="text/javascript" src="https://assets.pyecharts.org/assets/v5/echarts.min.js"></script></head>
<body ><div id="ef493756d92b45dcb840f2c58c5f385f" class="chart-container" style="width:900px; height:500px; "></div><script>var chart_ef493756d92b45dcb840f2c58c5f385f = echarts.init(document.getElementById('ef493756d92b45dcb840f2c58c5f385f'), 'white', {renderer: 'canvas'});var option_ef493756d92b45dcb840f2c58c5f385f = {"animation": true,"animationThreshold": 2000,"animationDuration": 1000,"animationEasing": "cubicOut","animationDelay": 0,"animationDurationUpdate": 300,"animationEasingUpdate": "cubicOut","animationDelayUpdate": 0,"aria": {"enabled": false},"color": ["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"series": [{"type": "bar","name": "\u5927\u4e00\u7684\u5b66\u4e60\u6548\u7387","legendHoverLink": true,"data": [10,20,30,40,50,40],"realtimeSort": false,"showBackground": false,"stack": "stack1","stackStrategy": "samesign","cursor": "pointer","barMinHeight": 0,"barCategoryGap": "20%","barGap": "30%","large": false,"largeThreshold": 400,"seriesLayoutBy": "column","datasetIndex": 0,"clip": true,"zlevel": 0,"z": 2,"label": {"show": false,"margin": 8},"rippleEffect": {"show": true,"brushType": "stroke","scale": 2.5,"period": 4}},{"type": "bar","name": "\u5927\u4e8c\u7684\u5b66\u4e60\u6548\u7387","legendHoverLink": true,"data": [20,30,50,60,70,80],"realtimeSort": false,"showBackground": false,"stack": "stack1","stackStrategy": "samesign","cursor": "pointer","barMinHeight": 0,"barCategoryGap": "20%","barGap": "30%","large": false,"largeThreshold": 400,"seriesLayoutBy": "column","datasetIndex": 0,"clip": true,"zlevel": 0,"z": 2,"label": {"show": false,"margin": 8},"rippleEffect": {"show": true,"brushType": "stroke","scale": 2.5,"period": 4}}],"legend": [{"data": ["\u5927\u4e00\u7684\u5b66\u4e60\u6548\u7387","\u5927\u4e8c\u7684\u5b66\u4e60\u6548\u7387"],"selected": {},"show": true,"padding": 5,"itemGap": 10,"itemWidth": 25,"itemHeight": 14,"backgroundColor": "transparent","borderColor": "#ccc","borderWidth": 1,"borderRadius": 0,"pageButtonItemGap": 5,"pageButtonPosition": "end","pageFormatter": "{current}/{total}","pageIconColor": "#2f4554","pageIconInactiveColor": "#aaa","pageIconSize": 15,"animationDurationUpdate": 800,"selector": false,"selectorPosition": "auto","selectorItemGap": 7,"selectorButtonGap": 10}],"tooltip": {"show": true,"trigger": "item","triggerOn": "mousemove|click","axisPointer": {"type": "line"},"showContent": true,"alwaysShowContent": false,"showDelay": 0,"hideDelay": 100,"enterable": false,"confine": false,"appendToBody": false,"transitionDuration": 0.4,"textStyle": {"fontSize": 14},"borderWidth": 0,"padding": 5,"order": "seriesAsc"},"xAxis": [{"show": true,"scale": false,"nameLocation": "end","nameGap": 15,"gridIndex": 0,"axisLabel": {"show": true,"rotate": -15,"margin": 8},"inverse": false,"offset": 0,"splitNumber": 5,"minInterval": 0,"splitLine": {"show": true,"lineStyle": {"show": true,"width": 1,"opacity": 1,"curveness": 0,"type": "solid"}},"data": ["\u9ad8\u7b49\u6570\u5b661\uff0c2","C\u8bed\u8a00\u7a0b\u5e8f\u8bbe\u8ba1","python\u7a0b\u5e8f\u8bbe\u8ba1","\u5927\u6570\u636e\u5bfc\u8bba","\u6570\u636e\u7ed3\u6784","\u5927\u6570\u636e\u4e0e\u4eba\u5de5\u667a\u80fd"]}],"yAxis": [{"show": true,"scale": false,"nameLocation": "end","nameGap": 15,"gridIndex": 0,"inverse": false,"offset": 0,"splitNumber": 5,"minInterval": 0,"splitLine": {"show": true,"lineStyle": {"show": true,"width": 1,"opacity": 1,"curveness": 0,"type": "solid"}}}],"title": [{"show": true,"text": "\u4fe1\u606f\u5de5\u7a0b\u5b66\u9662\u5b66\u4e60\u77e5\u8bc6\u6240\u5360\u767e\u5206\u6bd4","target": "blank","subtarget": "blank","padding": 5,"itemGap": 10,"textAlign": "auto","textVerticalAlign": "auto","triggerEvent": false}]
};chart_ef493756d92b45dcb840f2c58c5f385f.setOption(option_ef493756d92b45dcb840f2c58c5f385f);</script>
</body>
</html>

相关文章:
pycharm制作柱状图
Bar - Bar_rotate_xaxis_label 解决标签名字过长的问题 from pyecharts import options as opts from pyecharts.charts import Barc (Bar().add_xaxis(["高等数学1,2","C语言程序设计","python程序设计","大数据导论",…...
静态资源导入探究
静态资源可以在哪里找呢?我们看看源码 从这个类进去 里面有个静态类 WebMvcAutoConfigurationAdapter 有个配置类,将这个类的对象创建并导入IOC容器里 这个静态类下有个方法 addResourceHandlers(ResourceHandlerRegistry registry)静态资源处理器 若自…...
安全狗V3.512048版本绕过
安全狗安装 安全狗详细安装、遇见无此服务器解决、在windows中命令提示符中进入查看指定文件夹手动启动Apache_安全狗只支持 glibc_2.14 但是服务器是2.17_黑色地带(崛起)的博客-CSDN博客 安全狗 safedogwzApacheV3.5.exe 右键电脑右下角安全狗图标-->选择插件-->安装…...
prometheus监控k8s kube-proxy target down
prometheus kube-proxy target down 解决 修改配置 kubectl edit cm/kube-proxy -n kube-systemmetricsBindAddress: "0.0.0.0:10249"删除 kube-proxy pod 使之重启应用配置 kubectl delete pod --force `kubectl get pod -n kube-system |grep kube-proxy|awk {pr…...
SPSS数据分析--假设检验的两种原假设取舍决定方式
假设检验的两种原假设取舍决定方式 在t检验,相关分析,回归分析,方差分析,卡方检验等等分析方法中,都需要用到假设检验。假设检验的步骤一般如下: 提出假设:H0 vs H1 ;假设原假设H0 成立的情况…...
Python实现猫狗分类
不废话了,直接上代码: def load_imagepath_from_csv(csv_name):image_path []with open(csv_name,r) as file:csv_reader csv.reader(file)next(csv_reader)for row in csv_reader:image_path.append(row[0])return image_pathimport csv csv_name &…...
pjsip、pjsua2+bcg729 windows下编译java版本
文章目录 简要说明流程步骤 简要说明 基本参考的这里 https://docs.pjsip.org/en/latest/get-started/windows/build_instructions.html#building-the-projects 我这里主要是为了生成pjsua2.dll 用于在java下调用。 其中 libbcg729.dll 是通过vcpkg来进行安装。 pjsip使用vs2…...
尝试多数据表 sqlite
C 唯一值得骄傲的地方就是 通过指针来回寻址 😂 提高使用的灵活性 小脚本buff 加成...
Keil出现Flash Timeout.Reset the Target and try it again.我有一种解决方法
2.解决方法 网上查找了找原因,是因为之前代码设置了读保护功能。 读保护即大家通常说的“加密”,是作用于整个Flash存储区域。一旦设置了Flash的读保护,内置的Flash存储区只能通过程序的正常执行才能读出,而不能通过下述任何一种…...
纯粹即刻,畅享音乐搜索的轻松体验
纯粹即刻,畅享音乐搜索的轻松体验 在当今快节奏的生活中,我们常常渴望一种简单而便捷的方式来探索和享受音乐。现在,你可以纯粹即刻地畅享音乐搜索的轻松体验。无论你是寻找热门歌曲还是探索不同风格的音乐,这款应用将为你带来随…...
动态规划之树形DP
动态规划之树形DP 树形DP何为树形DP 树形DP例题HDU-1520 Anniversary partyHDU-2196 Computer834. 树中距离之和 树形DP 何为树形DP 树形DP是指在“树”这种数据结构上进行的动态规划:给出一颗树,要求以最少的代价(或取得最大收益ÿ…...
嵌入式_GD32使用宏开关进行Debug串口打印调试
嵌入式_GD32使用宏开关进行Debug串口打印调试 串口Debug是一种将数据通过串口发送的方法。通过使用printf函数,我们可以将需要发送的数据格式化为字符串,并通过串口发送出去。在C语言中,通常使用串口发送数据的函数为printf函数,…...
使用 GitHub Copilot 进行 Prompt Engineering 的初学者指南(译)
文章目录 什么是 GitHub Copilot ?GitHub Copilot 可以自己编码吗?GitHub Copilot 的底层是如何工作的?什么是 prompt engineering?这是 prompt engineering 的另一个例子 使用 GitHub Copilot 进行 prompt engineering 的最佳实践提供高级上下文&…...
c++开发模式,享元模式
享元模式,个人理解,就是应用共享技术来减少类的对象创建,节省计算机资源消耗,而且能够减少维护成本 #include <iostream> #include <string> #include <vector>using namespace std;class Flyweight { public:…...
LLM大模型——langchain相关知识总结
目录 一、简介LangChain的主要价值支柱简单安装 二、 LangChain的主要模块1.Model I/Oprompt模版定义调用语言模型 2. 数据连接3. chains4. Agents5. MemoryCallbacks 三、其他记录多进程调用 主要参考以下开源文档 文档地址:https://python.langchain.com/en/lates…...
【Python】数据可视化利器PyCharts在测试工作中的应用
目录 PyCharts 简介 PyCharts 的安装 缺陷统计 测试用例执行情况 使用JavaScript情况 缺陷趋势分析 将两张图放在一个组合里(grid) 将两张图重叠成一张图(overlap) 将多张图组合在一个page 中(page࿰…...
AOP的实战(统一功能处理模块)
一、用户登录权限效验 用户登录权限的发展从之前每个方法中自己验证用户登录权限,到现在统一的用户登录验证处理,它是一个逐渐完善和逐渐优化的过程。 1.1 最初用户登录验证 我们先来回顾一下最初用户登录验证的实现方法: RestController…...
时间复杂度为O(n2)的三种简单排序算法
1.冒泡排序 冒泡排序只会操作相邻的两个数据。每次冒泡操作都会对相邻的两个元素进行比较,看是否满足大小关系要求。如果不满足就让它俩互换。一次冒泡会让至少少一个元素移动到它应该在的位置,重复n次,就完成了n个数据的排序工作。 /*** …...
LeetCode 热题 100 JavaScript --226. 翻转二叉树
给你一棵二叉树的根节点 root ,翻转这棵二叉树,并返回其根节点。 示例 3: 输入:root [] 输出:[] 提示: 树中节点数目范围在 [0, 100] 内 -100 < Node.val < 100 var invertTree function(root…...
hive所有窗口函数详情总结
hive窗口函数详情总结 解释语法hive开窗函数排序开窗函数样例数据RANK()DENSE_RANK()ROW_NUMBER() 分析开窗函数样例数据:last_valuefirst_valuelaglead 其他窗口函数cume_distpercent_rank 解释 开窗函数用于为行定义一个窗口(指运算将要操作的行的集合…...
Android Wi-Fi 连接失败日志分析
1. Android wifi 关键日志总结 (1) Wi-Fi 断开 (CTRL-EVENT-DISCONNECTED reason3) 日志相关部分: 06-05 10:48:40.987 943 943 I wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid44:9b:c1:57:a8:90 reason3 locally_generated1解析: CTR…...
React 第五十五节 Router 中 useAsyncError的使用详解
前言 useAsyncError 是 React Router v6.4 引入的一个钩子,用于处理异步操作(如数据加载)中的错误。下面我将详细解释其用途并提供代码示例。 一、useAsyncError 用途 处理异步错误:捕获在 loader 或 action 中发生的异步错误替…...
零门槛NAS搭建:WinNAS如何让普通电脑秒变私有云?
一、核心优势:专为Windows用户设计的极简NAS WinNAS由深圳耘想存储科技开发,是一款收费低廉但功能全面的Windows NAS工具,主打“无学习成本部署” 。与其他NAS软件相比,其优势在于: 无需硬件改造:将任意W…...
C++实现分布式网络通信框架RPC(3)--rpc调用端
目录 一、前言 二、UserServiceRpc_Stub 三、 CallMethod方法的重写 头文件 实现 四、rpc调用端的调用 实现 五、 google::protobuf::RpcController *controller 头文件 实现 六、总结 一、前言 在前边的文章中,我们已经大致实现了rpc服务端的各项功能代…...
黑马Mybatis
Mybatis 表现层:页面展示 业务层:逻辑处理 持久层:持久数据化保存 在这里插入图片描述 Mybatis快速入门  刷机程序 和 镜像 就不提供了。要刷的时…...
大学生职业发展与就业创业指导教学评价
这里是引用 作为软工2203/2204班的学生,我们非常感谢您在《大学生职业发展与就业创业指导》课程中的悉心教导。这门课程对我们即将面临实习和就业的工科学生来说至关重要,而您认真负责的教学态度,让课程的每一部分都充满了实用价值。 尤其让我…...
Linux --进程控制
本文从以下五个方面来初步认识进程控制: 目录 进程创建 进程终止 进程等待 进程替换 模拟实现一个微型shell 进程创建 在Linux系统中我们可以在一个进程使用系统调用fork()来创建子进程,创建出来的进程就是子进程,原来的进程为父进程。…...
