python数据可视化坐标轴的定制

本文介绍了Python数据可视化的坐标轴定制,包括如何隐藏轴脊、部分轴脊以及移动轴脊,同时展示了使用mplot3d库创建3D图表,特别是3D曲面图的绘制。此外,还探讨了利用animation制作动态图表的方法。
摘要由CSDN通过智能技术生成

1.隐藏全部轴脊

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpathes
polygon = mpathes.RegularPolygon((0.5,0.5),6,0.2,color='g')
ax = plt.axes((0.3,0.3,0.5,0.5))
ax.add_patch(polygon)
ax.axis('off')
plt.title(2020080603035)
plt.show()

在这里插入图片描述
2.1.隐藏部分轴脊

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpathes
xy = np.array([0.5,0.5])
polygon = mpathes.RegularPolygon(xy,5,0.2,color='y')
ax = plt.axes((0.3,0.3,0.5,0.5))
ax.add_patch(polygon)
ax.spines['top'].set_color('none')
ax.spines['left'].set_color('none')
ax.spines['right'].set_color('none')
plt.title(2020080603035)
plt.show()

在这里插入图片描述

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpathes
xy = np.array([0.5,0.5])
polygon = mpathes.RegularPolygon(xy,5,0.2,color='y')
ax = plt.axes((0.3,0.3,0.5,0.5))
ax.add_patch(polygon)
ax.spines['top'].set_color('none')
ax.spines['left'].set_color('none')
ax.spines['right'].set_color('none')
ax.yaxis.set_ticks_position('none')
ax.set_yticklabels([])
plt.title(2020080603035)
plt.show()

在这里插入图片描述
实例:

import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter, HourLocator
plt.rcParams["font.sans-serif"] = ["SimHei"]
plt.rcParams["axes.unicode_minus"] = False
dates = ['201910240','2019102402','2019102404','2019102406',
         '2019102408','2019102410','2019102412'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值