用ChatGPT 4o画漂亮的燃尽图代码

2024-06-13 13:12
文章标签 chatgpt 代码 ai 漂亮 燃尽 4o

本文主要是介绍用ChatGPT 4o画漂亮的燃尽图代码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

把代码给ChatGPT,然后他就会帮我生成出来了。

而且图是动态的,可以调整颜色文字之类的内容

# Given data for Sprint 5 Progress
data_sprint_5 = {'User Story': ['BEAN-40', 'BEAN-42', 'BEAN-41', 'BEAN-22', 'BEAN-33', 'BEAN-44', 'BEAN-10', 'BEAN-26', 'BEAN-37', 'BEAN-36', 'BEAN-14', 'BEAN-39', 'BEAN-17', 'BEAN-38', 'BEAN-29', 'BEAN-9'],'Task': ['Build Test Framework Base on Python','Final Report','Summary Reports','As a staff member, I want to be able to send and receive messages so that I can communicate effectively with the customers and the managers','As a manager, I want to be able to send and receive messages so that I can communicate effectively with the customers and the managers','Design Test Cases','As a customer, I want to provide feedback on menu items so that I can contribute to improving the menu and share my experiences with the business','As a manager, I want to manage a points-based rewards system so that I can engage customers and drive sales','Should display the estimated preparation time, When selecting the option for immediate pickup','Add multiple quantities of the same item from the product page!','As a customer, I want to be able to send and receive messages so that I can communicate effectively with the staff members','Design Test Framework and Strategy','As a customer, I want to view and manage my points-based rewards section so that I can manage my points','Error info when click booking button','As a manager, I want to view management reports to gain insights into customer behaviour and preferences so that I can take informed business decisions','As a customer, I want to view my past orders so that I can easily reorder favourite items and track my purchase history'],'Developer': ['Cedar', 'Cedar', 'Cedar', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun'],'Estimated Hours': [10, 10, 10, 11, 9, 9, 12, 9, 12, 10, 5, 5, 5, 5, 5, 5]
}# Create a DataFrame from the given data
sprint_5_df = pd.DataFrame(data_sprint_5)# Dates for the sprint
dates_sprint_5 = pd.date_range(start="2024-06-05", end="2024-06-10")# Initialize remaining hours with total estimated hours at the start of the sprint
total_hours_sprint_5 = sprint_5_df['Estimated Hours'].sum()
remaining_hours_sprint_5 = total_hours_sprint_5
actual_burndown_sprint_5 = [remaining_hours_sprint_5]# Update remaining hours only when a task is completed
for i, row in sprint_5_df.iterrows():# For this example, assume all tasks are completedremaining_hours_sprint_5 -= row['Estimated Hours']actual_burndown_sprint_5.append(remaining_hours_sprint_5)# Extend the actual burndown to match the length of the dates if needed
while len(actual_burndown_sprint_5) < len(dates_sprint_5) + 1:actual_burndown_sprint_5.append(remaining_hours_sprint_5)# Ideal burndown calculation
ideal_burndown_sprint_5 = [total_hours_sprint_5 - (total_hours_sprint_5 / len(dates_sprint_5)) * i for i in range(len(dates_sprint_5))]# Ensure the lengths are the same for plotting
if len(actual_burndown_sprint_5) > len(dates_sprint_5) + 1:actual_burndown_sprint_5 = actual_burndown_sprint_5[:len(dates_sprint_5) + 1]# Plotting the Burndown Chart
plt.figure(figsize=(10, 6))
plt.plot(dates_sprint_5, ideal_burndown_sprint_5, label='Ideal Burn Down', linestyle='--')
plt.plot(dates_sprint_5.insert(0, dates_sprint_5[0] - pd.Timedelta(days=1)), actual_burndown_sprint_5, label='Remaining Effort', marker='o')
plt.xlabel('Date')
plt.ylabel('Hours Remaining')
plt.title('Sprint 5 Burndown Chart')
plt.legend()
plt.grid(True)
plt.xticks(dates_sprint_5, rotation=45)
plt.yticks(range(0, total_hours_sprint_5 + 1, 5))
plt.tight_layout()plt.show()

调整后的图

这篇关于用ChatGPT 4o画漂亮的燃尽图代码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!


原文地址:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.chinasem.cn/article/1057397

相关文章

MySQL 添加索引5种方式示例详解(实用sql代码)

《MySQL添加索引5种方式示例详解(实用sql代码)》在MySQL数据库中添加索引可以帮助提高查询性能,尤其是在数据量大的表中,下面给大家分享MySQL添加索引5种方式示例详解(实用sql代码),... 在mysql数据库中添加索引可以帮助提高查询性能,尤其是在数据量大的表中。索引可以在创建表时定义,也可

使用C#删除Excel表格中的重复行数据的代码详解

《使用C#删除Excel表格中的重复行数据的代码详解》重复行是指在Excel表格中完全相同的多行数据,删除这些重复行至关重要,因为它们不仅会干扰数据分析,还可能导致错误的决策和结论,所以本文给大家介绍... 目录简介使用工具C# 删除Excel工作表中的重复行语法工作原理实现代码C# 删除指定Excel单元

Python实现一键PDF转Word(附完整代码及详细步骤)

《Python实现一键PDF转Word(附完整代码及详细步骤)》pdf2docx是一个基于Python的第三方库,专门用于将PDF文件转换为可编辑的Word文档,下面我们就来看看如何通过pdf2doc... 目录引言:为什么需要PDF转Word一、pdf2docx介绍1. pdf2docx 是什么2. by

Spring Security介绍及配置实现代码

《SpringSecurity介绍及配置实现代码》SpringSecurity是一个功能强大的Java安全框架,它提供了全面的安全认证(Authentication)和授权(Authorizatio... 目录简介Spring Security配置配置实现代码简介Spring Security是一个功能强

通过cmd获取网卡速率的代码

《通过cmd获取网卡速率的代码》今天从群里看到通过bat获取网卡速率两段代码,感觉还不错,学习bat的朋友可以参考一下... 1、本机有线网卡支持的最高速度:%v%@echo off & setlocal enabledelayedexpansionecho 代码开始echo 65001编码获取: >

Java集成Onlyoffice的示例代码及场景分析

《Java集成Onlyoffice的示例代码及场景分析》:本文主要介绍Java集成Onlyoffice的示例代码及场景分析,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要... 需求场景:实现文档的在线编辑,团队协作总结:两个接口 + 前端页面 + 配置项接口1:一个接口,将o

SpringBoot实现Kafka动态反序列化的完整代码

《SpringBoot实现Kafka动态反序列化的完整代码》在分布式系统中,Kafka作为高吞吐量的消息队列,常常需要处理来自不同主题(Topic)的异构数据,不同的业务场景可能要求对同一消费者组内的... 目录引言一、问题背景1.1 动态反序列化的需求1.2 常见问题二、动态反序列化的核心方案2.1 ht

IDEA实现回退提交的git代码(四种常见场景)

《IDEA实现回退提交的git代码(四种常见场景)》:本文主要介绍IDEA实现回退提交的git代码(四种常见场景),具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.已提交commit,还未push到远端(Undo Commit)2.已提交commit并push到

Kotlin Compose Button 实现长按监听并实现动画效果(完整代码)

《KotlinComposeButton实现长按监听并实现动画效果(完整代码)》想要实现长按按钮开始录音,松开发送的功能,因此为了实现这些功能就需要自己写一个Button来解决问题,下面小编给大... 目录Button 实现原理1. Surface 的作用(关键)2. InteractionSource3.

使用Java实现Navicat密码的加密与解密的代码解析

《使用Java实现Navicat密码的加密与解密的代码解析》:本文主要介绍使用Java实现Navicat密码的加密与解密,通过本文,我们了解了如何利用Java语言实现对Navicat保存的数据库密... 目录一、背景介绍二、环境准备三、代码解析四、核心代码展示五、总结在日常开发过程中,我们有时需要处理各种软