我正在构建一个用于数据分析的小工具,我已经到了这一点,我必须绘制准备好的数据.此前的代码生成以下两个长度相等的列表.
t11 = ['00', '01', '02', '03', '04', '05', '10', '11', '12', '13', '14', '15', '20', '21', '22', '23', '24', '25', '30', '31', '32', '33', '34', '35', '40', '41', '42', '43', '44', '45', '50', '51', '52', '53', '54', '55']
t12 = [173, 135, 141, 148, 140, 149, 152, 178, 135, 96, 109, 164, 137, 152, 172, 149, 93, 78, 116, 81, 149, 202, 172, 99, 134, 85, 104, 172, 177, 150, 130, 131, 111, 99, 143, 194]
Run Code Online (Sandbox Code Playgroud)
基于此,我想用matplotlib.plt.hist建立一个直方图.但是,存在一些问题:1.对于所有x,连接t11 [x]和t12 [x].其中t11 …
我喜欢制作高质量的地块,因此尽可能避免光栅化的图形.
我正在尝试将svg文件导入到matplotlib图中:
import matplotlib.pyplot as plt
earth = plt.imread('./gfx/earth.svg')
fig, ax = plt.subplots()
im = ax.imshow(earth)
plt.show()
Run Code Online (Sandbox Code Playgroud)
这与png完美配合.有人可以告诉我如何使用svg或至少指出我的正确文档.
我知道有一个类似的问题已经被问到(但没有回答):这里.从那以后有什么变化吗
PS我知道我可以导出高分辨率的png并实现类似的效果.这不是我要找的解决方案.
这是我要导入的图像:Earth_from_above.
任何提示都表示赞赏.谢谢!
我是stackoverflow和python的新手,所以这看起来很明显:
在此过程中,我想从前一过程生成的文件列表中创建一个名为database的新文件.列表中的文件非常大(大约13.6 MB).目标是使用包含所有其他行的单个文件:
database = open('current_database', 'a')
def file_apender(new):
for line in new:
database.write(line)
def file_join(list_of_files):
for file in list_of_files:
file_apender(file)
Run Code Online (Sandbox Code Playgroud)
如果我:
file_join(a_file_list)
Run Code Online (Sandbox Code Playgroud)
我得到了数据库文件,但缺少26行,最后一行未完成.这是文件的结尾:
63052300774565. 12 4 3 0 0.37 0.79 10.89 12.00 1.21 25.26 0.00 0.00 0.00 0.00
63052300774565. 12 2 0 0 0.06 0.12 2.04 2.21 0.86 5.30 0.00 0.00 0.00 0.00
63052300774565. 12 0 0 0 0.12 0.26 3.13 4.63 3.81 11.95 0.00 0.00 0.00 0.00
63052300774565. 12 2 2 0 0.06 0.15 1.35 2.39 0.00 3.94 …
Run Code Online (Sandbox Code Playgroud)