05 2020 档案

摘要:python之使用pygal模拟掷两颗面数为6的骰子的直方图,包含三个文件,主文件,die.py,dice_visual.py,20200527.svg。其中最后一个文件为程序运行得到的结果。 1,die.py,原码如下: 1 from random import randint 2 3 class 阅读全文
posted @ 2020-05-27 12:02 、一叶孤城 阅读(340) 评论(0) 推荐(0) 编辑
摘要:1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>一个简单的CSS示例</title> 6 <style> 7 .main{ 8 width: 800px; 9 margin: 0 auto; 10 } 1 阅读全文
posted @ 2020-05-22 15:49 、一叶孤城 阅读(246) 评论(0) 推荐(0) 编辑
摘要:最近有点懒,没码什么字,防止遗忘,从头开始码,写一个简单的HTML留言板。包含两个文件,book.html还有style.css,放在同一目录下。 book.html 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 < 阅读全文
posted @ 2020-05-22 15:33 、一叶孤城 阅读(11020) 评论(2) 推荐(1) 编辑
摘要:python之使用pygal模拟掷骰子创建直方图: 1,文件die.py,源码如下: 1 from random import randint 2 3 class Die(): 4 '''表示一个骰子的类''' 5 def __init__(self,num_sides = 6): 6 '''初始化 阅读全文
posted @ 2020-05-20 16:36 、一叶孤城 阅读(192) 评论(0) 推荐(0) 编辑
摘要:Matplotlib之scatter 1,使用scatter绘制散点图并设置其样式: 1 import matplotlib.pyplot as plt 2 3 '''使用scatter绘制散点图并设置其样式''' 4 square = [1,4,s=200] 5 6 plt.title("Squa 阅读全文
posted @ 2020-05-19 10:00 、一叶孤城 阅读(706) 评论(0) 推荐(0) 编辑
摘要:1,绘制简单的折线图。 1 import matplotlib.pyplot as plt 2 3 square = [1,4,9,16,25] 4 5 plt.plot(square) 6 plt.show() 2,使用matplotlib修改折现图的标签文字和线条粗细。 1 '''修改标签文字和 阅读全文
posted @ 2020-05-19 09:29 、一叶孤城 阅读(229) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示