用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

相关文章

Java调用DeepSeek API的最佳实践及详细代码示例

《Java调用DeepSeekAPI的最佳实践及详细代码示例》:本文主要介绍如何使用Java调用DeepSeekAPI,包括获取API密钥、添加HTTP客户端依赖、创建HTTP请求、处理响应、... 目录1. 获取API密钥2. 添加HTTP客户端依赖3. 创建HTTP请求4. 处理响应5. 错误处理6.

Spring AI集成DeepSeek的详细步骤

《SpringAI集成DeepSeek的详细步骤》DeepSeek作为一款卓越的国产AI模型,越来越多的公司考虑在自己的应用中集成,对于Java应用来说,我们可以借助SpringAI集成DeepSe... 目录DeepSeek 介绍Spring AI 是什么?1、环境准备2、构建项目2.1、pom依赖2.2

使用 sql-research-assistant进行 SQL 数据库研究的实战指南(代码实现演示)

《使用sql-research-assistant进行SQL数据库研究的实战指南(代码实现演示)》本文介绍了sql-research-assistant工具,该工具基于LangChain框架,集... 目录技术背景介绍核心原理解析代码实现演示安装和配置项目集成LangSmith 配置(可选)启动服务应用场景

Python中顺序结构和循环结构示例代码

《Python中顺序结构和循环结构示例代码》:本文主要介绍Python中的条件语句和循环语句,条件语句用于根据条件执行不同的代码块,循环语句用于重复执行一段代码,文章还详细说明了range函数的使... 目录一、条件语句(1)条件语句的定义(2)条件语句的语法(a)单分支 if(b)双分支 if-else(

Deepseek R1模型本地化部署+API接口调用详细教程(释放AI生产力)

《DeepseekR1模型本地化部署+API接口调用详细教程(释放AI生产力)》本文介绍了本地部署DeepSeekR1模型和通过API调用将其集成到VSCode中的过程,作者详细步骤展示了如何下载和... 目录前言一、deepseek R1模型与chatGPT o1系列模型对比二、本地部署步骤1.安装oll

Spring AI Alibaba接入大模型时的依赖问题小结

《SpringAIAlibaba接入大模型时的依赖问题小结》文章介绍了如何在pom.xml文件中配置SpringAIAlibaba依赖,并提供了一个示例pom.xml文件,同时,建议将Maven仓... 目录(一)pom.XML文件:(二)application.yml配置文件(一)pom.xml文件:首

MySQL数据库函数之JSON_EXTRACT示例代码

《MySQL数据库函数之JSON_EXTRACT示例代码》:本文主要介绍MySQL数据库函数之JSON_EXTRACT的相关资料,JSON_EXTRACT()函数用于从JSON文档中提取值,支持对... 目录前言基本语法路径表达式示例示例 1: 提取简单值示例 2: 提取嵌套值示例 3: 提取数组中的值注意

CSS3中使用flex和grid实现等高元素布局的示例代码

《CSS3中使用flex和grid实现等高元素布局的示例代码》:本文主要介绍了使用CSS3中的Flexbox和Grid布局实现等高元素布局的方法,通过简单的两列实现、每行放置3列以及全部代码的展示,展示了这两种布局方式的实现细节和效果,详细内容请阅读本文,希望能对你有所帮助... 过往的实现方法是使用浮动加

JAVA调用Deepseek的api完成基本对话简单代码示例

《JAVA调用Deepseek的api完成基本对话简单代码示例》:本文主要介绍JAVA调用Deepseek的api完成基本对话的相关资料,文中详细讲解了如何获取DeepSeekAPI密钥、添加H... 获取API密钥首先,从DeepSeek平台获取API密钥,用于身份验证。添加HTTP客户端依赖使用Jav

Java实现状态模式的示例代码

《Java实现状态模式的示例代码》状态模式是一种行为型设计模式,允许对象根据其内部状态改变行为,本文主要介绍了Java实现状态模式的示例代码,文中通过示例代码介绍的非常详细,需要的朋友们下面随着小编来... 目录一、简介1、定义2、状态模式的结构二、Java实现案例1、电灯开关状态案例2、番茄工作法状态案例