当前位置: 首页 > news >正文

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&#xff0c;2","C语言程序设计","python程序设计","大数据导论",…...

静态资源导入探究

静态资源可以在哪里找呢&#xff1f;我们看看源码 从这个类进去 里面有个静态类 WebMvcAutoConfigurationAdapter 有个配置类&#xff0c;将这个类的对象创建并导入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检验&#xff0c;相关分析&#xff0c;回归分析&#xff0c;方差分析&#xff0c;卡方检验等等分析方法中&#xff0c;都需要用到假设检验。假设检验的步骤一般如下&#xff1a; 提出假设&#xff1a;H0 vs H1 ;假设原假设H0 成立的情况…...

Python实现猫狗分类

不废话了&#xff0c;直接上代码&#xff1a; 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 唯一值得骄傲的地方就是 通过指针来回寻址 &#x1f602; 提高使用的灵活性 小脚本buff 加成...

Keil出现Flash Timeout.Reset the Target and try it again.我有一种解决方法

2.解决方法 网上查找了找原因&#xff0c;是因为之前代码设置了读保护功能。 读保护即大家通常说的“加密”&#xff0c;是作用于整个Flash存储区域。一旦设置了Flash的读保护&#xff0c;内置的Flash存储区只能通过程序的正常执行才能读出&#xff0c;而不能通过下述任何一种…...

纯粹即刻,畅享音乐搜索的轻松体验

纯粹即刻&#xff0c;畅享音乐搜索的轻松体验 在当今快节奏的生活中&#xff0c;我们常常渴望一种简单而便捷的方式来探索和享受音乐。现在&#xff0c;你可以纯粹即刻地畅享音乐搜索的轻松体验。无论你是寻找热门歌曲还是探索不同风格的音乐&#xff0c;这款应用将为你带来随…...

动态规划之树形DP

动态规划之树形DP 树形DP何为树形DP 树形DP例题HDU-1520 Anniversary partyHDU-2196 Computer834. 树中距离之和 树形DP 何为树形DP 树形DP是指在“树”这种数据结构上进行的动态规划&#xff1a;给出一颗树&#xff0c;要求以最少的代价&#xff08;或取得最大收益&#xff…...

嵌入式_GD32使用宏开关进行Debug串口打印调试

嵌入式_GD32使用宏开关进行Debug串口打印调试 串口Debug是一种将数据通过串口发送的方法。通过使用printf函数&#xff0c;我们可以将需要发送的数据格式化为字符串&#xff0c;并通过串口发送出去。在C语言中&#xff0c;通常使用串口发送数据的函数为printf函数&#xff0c;…...

使用 GitHub Copilot 进行 Prompt Engineering 的初学者指南(译)

文章目录 什么是 GitHub Copilot ?GitHub Copilot 可以自己编码吗&#xff1f;GitHub Copilot 的底层是如何工作的&#xff1f;什么是 prompt engineering?这是 prompt engineering 的另一个例子 使用 GitHub Copilot 进行 prompt engineering 的最佳实践提供高级上下文&…...

c++开发模式,享元模式

享元模式&#xff0c;个人理解&#xff0c;就是应用共享技术来减少类的对象创建&#xff0c;节省计算机资源消耗&#xff0c;而且能够减少维护成本 #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 三、其他记录多进程调用 主要参考以下开源文档 文档地址&#xff1a;https://python.langchain.com/en/lates…...

【Python】数据可视化利器PyCharts在测试工作中的应用

目录 PyCharts 简介 PyCharts 的安装 缺陷统计 测试用例执行情况 使用JavaScript情况 缺陷趋势分析 将两张图放在一个组合里&#xff08;grid&#xff09; 将两张图重叠成一张图&#xff08;overlap&#xff09; 将多张图组合在一个page 中&#xff08;page&#xff0…...

AOP的实战(统一功能处理模块)

一、用户登录权限效验 用户登录权限的发展从之前每个方法中自己验证用户登录权限&#xff0c;到现在统一的用户登录验证处理&#xff0c;它是一个逐渐完善和逐渐优化的过程。 1.1 最初用户登录验证 我们先来回顾一下最初用户登录验证的实现方法&#xff1a; RestController…...

时间复杂度为O(n2)的三种简单排序算法

1.冒泡排序 冒泡排序只会操作相邻的两个数据。每次冒泡操作都会对相邻的两个元素进行比较&#xff0c;看是否满足大小关系要求。如果不满足就让它俩互换。一次冒泡会让至少少一个元素移动到它应该在的位置&#xff0c;重复n次&#xff0c;就完成了n个数据的排序工作。 /*** …...

LeetCode 热题 100 JavaScript --226. 翻转二叉树

给你一棵二叉树的根节点 root &#xff0c;翻转这棵二叉树&#xff0c;并返回其根节点。 示例 3&#xff1a; 输入&#xff1a;root [] 输出&#xff1a;[] 提示&#xff1a; 树中节点数目范围在 [0, 100] 内 -100 < Node.val < 100 var invertTree function(root…...

hive所有窗口函数详情总结

hive窗口函数详情总结 解释语法hive开窗函数排序开窗函数样例数据RANK()DENSE_RANK()ROW_NUMBER() 分析开窗函数样例数据&#xff1a;last_valuefirst_valuelaglead 其他窗口函数cume_distpercent_rank 解释 开窗函数用于为行定义一个窗口&#xff08;指运算将要操作的行的集合…...

Talk | 新加坡国立大学博士生施宇钧:DragDiffusion-基于扩散模型的关键点拖拽图片编辑

本期为TechBeat人工智能社区第518期线上Talk&#xff01; 北京时间8月2日(周三)20:00&#xff0c; 新加坡国立大学博士生—施宇钧的Talk已准时在TechBeat人工智能社区开播&#xff01; 他与大家分享的主题是: “DragDiffusion-基于扩散模型的关键点拖拽图片编辑”&#xff0c;他…...

22 | 贝叶斯分类算法

文章目录 介绍什么是贝叶斯分类算法?贝叶斯分类算法的应用场景贝叶斯定理贝叶斯定理的基本原理贝叶斯定理的公式推导贝叶斯定理的应用举例代码介绍 什么是贝叶斯分类算法? 贝叶斯分类算法是一类基于贝叶斯定理的分类技术。在统计分类任务中,这些算法使用特定的假设来建立特…...

java.sql.SQLSyntaxErrorException: ORA-00909: 参数个数无效

问题&#xff1a; 在Select里采用Contact(%,#name,%)报错参数个数无效 原因&#xff1a; 回想以前用Mysql的时候就是这样用的&#xff0c;没有问题&#xff0c;在这里就出问题了&#xff0c;所以确定问题在oracle数据库上&#xff0c;经过查询得知&#xff0c;oracle和mysql…...

数据结构8-哈希表

数据结构8-哈希表 动态分配内存方式&#xff1a; #include <stdio.h> #include <stdlib.h>#define SIZE 20struct DataItem {int data; int key; };struct DataItem* hashArray[SIZE]; struct DataItem* dummyItem; struct DataItem* item;//获取键值 int has…...

vue3引用Font-Awesome字体图标库

环境&#xff1a;vue3tsviteelement plus 介绍&#xff1a;这里安装引用的是Font-Awesome 6.x 版本&#xff0c;有专业版&#xff08;付费&#xff09;&#xff0c;这里只介绍免费版字体使用方法 一、安装 1.使用npm安装&#xff0c;终端打开项目目录或者命令行cd到目录文件夹…...

Python: Django 服务部署可能遇到的一些问题

502 bad gateway 不要用 python3 manage.py runserver 启动服务&#xff0c; 而要用&#xff1a; daphne -b 0.0.0.0 -p <端口> <工程名>.asgi:application此外&#xff0c;在 setting.py 中&#xff0c;修改&#xff1a; import osSECRET_KEY os.environ.get(D…...

Python爬虫时遇到连接超时解决方案

在进行Python爬虫任务时&#xff0c;经常会遇到连接超时&#xff08;TimeoutError&#xff09;错误。连接超时意味着爬虫无法在规定的时间内建立与目标服务器的连接&#xff0c;导致请求失败。为了帮助您解决这个常见的问题&#xff0c;本文将提供一些解决办法&#xff0c;并提…...

这所国字头双一流,根本招不满,学硕都没人报!

一、学校及专业介绍 中国民航大学&#xff0c;位于天津市&#xff0c;是民航局、天津市、教育部共建高校&#xff0c;是天津市“双一流”建设高校和高水平特色大学建设高校。 1.1 招生情况 2023年中国民航大学电子信息与自动化学院&#xff0c;初试考806信号与系统的一共有两…...

macos 查询端口占用 命令

在 macOS 上查询端口占用的命令是通过使用lsof&#xff08;list open files&#xff09;工具来实现的。 lsof可以显示当前系统中打开的文件&#xff08;包括网络连接和端口&#xff09;的相关信息。 打开终端应用程序&#xff08;Terminal&#xff09;&#xff0c;然后输入以下…...

无代码开发:打破传统开发模式,引领数字化转型新方向

随着数字化转型的加速&#xff0c;企业对于高效、便捷的软件开发需求愈发旺盛。无代码开发作为一种新兴的软件开发模式&#xff0c;以其可视化、模块化的开发方式&#xff0c;为数字化转型提供了新的方向。本文将从无代码开发的优势、应用场景、如何实现等方面进行详细解读&…...