- 博客(14)
- 资源 (35)
- 收藏
- 关注
原创 【记录】双y轴x刻度旋转问题
import matplotlib.pyplot as pltimport numpy as npfrom matplotlib import rcParamsimport warningstitle_size = 10plt.rcParams['xtick.direction'] = 'in'plt.rcParams['ytick.direction'] = 'in'figsize = (5, 2.5)adjust = {'top': 0.93, 'bottom': 0.16, 'rig
2022-03-27 20:49:35 702
原创 【记录】解决visio流程图复制到word中字符间距改变的问题
原回答:This definitely looks like a bug. I solved the problem by selecting the objects I wanted in Visio, the select File->Save As… and for file extension, choose “.png”. In the next dialog box, for resolution, select the “Printer” option. Then this image
2021-11-25 21:39:21 2866
原创 【记录】python画图样式选择,去边框
import matplotlib.pyplot as pltimport numpy as npfrom matplotlib import rcParams# print(plt.style.available) # 查看可选择的样式figsize = (5, 2.9)title_size = 10plt.rcParams['xtick.direction'] = 'in'plt.rcParams['ytick.direction'] = 'in'time = np.arange
2021-09-06 16:07:03 1800
原创 【记录】python画图双y轴图例合并,图例位置控制,输出为svg格式,保存图片白边大小控制
import numpy as npimport matplotlib.pyplot as pltfrom matplotlib import rcParamsconfig = { "font.family": 'serif', # "font.family": 'Times New Roman', "font.size": 12, "mathtext.fontset": 'stix',
2021-05-18 16:21:21 988
原创 【记录】python饼状图和条形图
import numpy as npimport pandas as pdimport matplotlib.pyplot as pltfrom openpyxl.workbook import Workbookfrom matplotlib import rcParamsfrom matplotlib.pyplot import MultipleLocatorconfig = { "font.family": 'serif', "font.si
2020-12-20 22:15:38 302
原创 【记录】Python画图,设置填充,填充方式,图像层级
import numpy as npimport matplotlib.pyplot as pltfrom matplotlib import rcParamsfrom matplotlib.pyplot import MultipleLocatora = np.arange(1, 16).reshape(15).tolist()b = np.arange(1, 16).reshape(15).tolist()c = np.arange(2, 32, 2).reshape(15).tolist
2020-12-05 20:38:54 2030
原创 【记录】使用Python+emf转换工具生成矢量图
说明:文章转自原文为防止原文删除,记录如下:由于论文出图需要,用matplotlib生成的png格式的图像放大后明显模糊,因此可以将其直接保存为pdf格式,之后再经过几次转换就可以导入到word中,具体步骤如下:1 用matplotlib将图像保存为pdf文件,设置为’tight’可以使图片边框更紧凑一点plt.savefig('pic.pdf', bbox_inches='tight')2 由于保存的pdf文件图像边界可能有空白部分,因此可以采用Acrobat进行裁剪,并保存为eps格式图片
2020-11-25 20:00:27 2019
原创 【记录】使用Python画图,并设置中文字体为宋体,英文字体为Times New Roman
import matplotlib.pyplot as pltfrom matplotlib import rcParamsconfig = { "font.family": 'serif', "font.size": 15, "mathtext.fontset": 'stix', "font.serif": ['SimSun'], }rcParams.update(config)x
2020-11-06 19:07:42 22540 12
原创 【记录】np.dot以及np.insert用法
import numpy as npa = [1, 2, 3]b = np.arange(1, 7).reshape(3, 2)print(b)# [[1 2]# [3 4]# [5 6]]c = np.dot(a, b) # np.dot表示向量a与矩阵b的乘积[1×3]·[3×2]=[1×2]print(c)# [22 28]d = np.insert(b, 2, a, axis=1) # np.insert表示在矩阵b的基础上增加向量a,axis=1表示增加的向量
2020-10-29 13:02:19 223
原创 【记录】matplotlib.pyplot画图并设置横坐标为日期格式
import pandas as pdimport matplotlib.pyplot as pltimport matplotlib.dates as mdatesx = pd.date_range(start='2020/01/01', end='2020/01/03', freq='D')y = [1, 2, 3]fig = plt.figure()ax = fig.add_subplot(111)plt.gca().xaxis.set_major_formatter(mdates.D
2020-09-14 22:22:33 7691
原创 【记录】让list中的元素重复N次
在这里插入代码片n = 10a = [1,2,3,4,5] b = a * nprint b #[1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, # 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, # 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, # 1, 2, 3, 4, 5] c = []for i in a: for j in range(n
2020-09-07 19:43:10 2852
原创 【记录】pandas中to_datetime使用
#to_datetime使用示例#df = pd.DataFrame({'year': [2015, 2016], 'month': [2, 3], 'day': [4, 5]})date = pd.to_datetime(df)print(date)#0 2015-02-04#1 2016-03-05官方文档to_datetime
2020-09-07 19:42:21 452
原创 【记录】pandas中date_range函数使用示例
#pandas中date_range函数使用示例import pandas as pdimport numpy as nptest = np.arange(1, 13).reshape(12)print(test)#[ 1 2 3 4 5 6 7 8 9 10 11 12]index = pd.date_range(start='2020-1-1', end='2020-12-1', freq='MS')print(index)#DatetimeIndex(['2020-0
2020-09-07 19:41:51 722
原创 【记录】创建DataFrame索引
【记录】创建DataFrame索引并取值// An highlighted a = np.arange(1, 25).reshape(12, 2)print(a)[[ 1 2] [ 3 4] [ 5 6] [ 7 8] [ 9 10] [11 12] [13 14] [15 16] [17 18] [19 20] [21 22] [23 24]]name = 'month'name_year = 'year'month_index = []month_inde
2020-09-07 19:41:32 493
电压稳定simulink仿真.zip
2020-04-07
VC++6.0图像处理算法.zip
2020-04-07
图像处理学习代码_包括Hough变换_walsh变换等.zip
2020-04-07
人脸识别系统设计.zip
2020-04-07
微电网下垂控制策略仿真模型.rar
2020-01-10
微电网下垂控制simulink仿真.zip
2020-01-10
汽车监控仪代码实现——基于ARM9
2019-12-02
arm-linux-cross-3.4.4.rar
2019-12-02
SPWM_simulink.zip
2019-12-02
基于DSP28335的CAN通信配置工程
2019-12-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人