# coding=utf-8# 代码文件:code/chapter10/10.3.py# 3D柱状图import random
from pyecharts import options as opts
from pyecharts.charts import Bar3D
# 生成测试数据
data =[[x, y, random.randint(10,40)]for y inrange(7)for x inrange(24)]
hours =['12a','1a','2a','3a','4a','5a','6a','7a','8a','9a','10a','11a','12p','1p','2p','3p','4p','5p','6p','7p','8p','9p','10p','11p',]
weeks =['星期六','星期五','星期四','星期三','星期二','星期一','星期日']
c =(
Bar3D(init_opts=opts.InitOpts(width='1200px', height='600px')).add('',
data,
xaxis3d_opts=opts.Axis3DOpts(name='小时', data=hours),
yaxis3d_opts=opts.Axis3DOpts(name='星期', data=weeks),
zaxis3d_opts=opts.Axis3DOpts(name='温度'),).set_global_opts(
visualmap_opts=opts.VisualMapOpts(max_=50, min_=0),
title_opts=opts.TitleOpts(title='Q市7×24小时温度'),).render('data/3D柱状图.html'))
Windows x64/86 C无依赖运行高斯伪谱法求解最优控制问题,你只需要ElegantGP!
Author: Y. F. Zhang His Github: https://github.com/ZYunfeii
写在前面
这个库在你下载它的那一时刻起不再依赖任何其他代码,直接可用来构建C的最优控制问题并进行求解。…