MATLAB制图代码【第二版】

MATLAB制图代码【第二版】

文档描述

Code describtion: This code is version 2 used for processing the data from the simulation and experiment.

Time : 2023.9.3

Author: PEZHANG

这是在第一版基础上,迭代出的第二版MATLAB制图代码,第二版的特点是以handle 的形式控制图窗的properties,此种形式更加贴近MATLAB的内在。

前置知识

figure图窗分为曲线、坐标轴、图窗背景三部分,这三个部分可以通过handle的形式对其properties进行操纵。

源代码

c 复制代码
clc;clear
close all

% get x、y data
x = 0:pi/20:2*pi;
y = sin(x);

% get the properties of line
l = plot(x,y);
l.LineWidth = 1;

% get the properties of figure
h = gcf;
h.Color = 'w';
h.Units = 'centimeters';
h.Position = [25 10 15 9];

% get the properties of axes
ax = gca;
ax.YGrid = 'on';
ax.FontSize = 13;
ax.XLabel.String = '时间 (s)';
ax.YLabel.String = '振幅 (m)';
ax.Title.String = '示例-正弦曲线';
ax.GridLineStyle = '--';
ax.Box = 'off';
print('-djpeg','-r600','示例-正弦曲线')

代码运行结果图

参考资料

【1】https://www.youtube.com/watch?v=CNayChYLAV8

【2】https://www.youtube.com/watch?v=sPC1-7K6qNU

【3】https://blog.csdn.net/qq_50632468/article/details/129691250

相关推荐
Cthy_hy37 分钟前
浏览器市场分析——数据大屏动态数据接入
信息可视化·etl·数据可视化
fengfuyao9852 小时前
基于MATLAB的HHT变换完整实现(含EMD分解与三维时频谱生成)
开发语言·算法·matlab
Deep-w2 小时前
【MATLAB】基于 MATLAB 的直流电动机双闭环调速系统建模与仿真
开发语言·算法·matlab
一晌小贪欢3 小时前
第19节:地理空间分析——使用 Geopandas 绘制热力地图
开发语言·python·数据分析·pandas·数据可视化
T.i.s1 天前
论文复现8
matlab·fmcw
海神之光1 天前
【语音识别】基于matlab语音MFCC特征提取CNN深度学习语音识别【含Matlab源码 14470期】
matlab
weixin_505154461 天前
打通工业安全治理“最后一公分”:Bowell 发布 Runtime 治理平台
大数据·人工智能·安全·3d·数字孪生·数据可视化
Evand J1 天前
【自适应滤波】基于新息协方差匹配的自适应CKF目标跟踪 MATLAB 实战——在目标跟踪、雷达定位、组合导航和传感器融合等问题
人工智能·matlab·目标跟踪
无心使然1 天前
OpenLayers 10.9.0 渲染架构分析
前端·gis·数据可视化
三行数学2 天前
Matlab之父克利夫·莫勒尔逝世
开发语言·matlab