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

相关推荐
2zcode5 小时前
基于MATLAB车辆拥堵密度依赖的自适应交通信号控制系统
人工智能·计算机视觉·matlab
Jason_gao9998 小时前
【无标题】
matlab·信息与通信
2zcode10 小时前
基于MATLAB神经网络的心力衰竭预测与临床辅助决策系统研究
人工智能·神经网络·matlab
太平洋月光11 小时前
Antv G2中自定义技巧📊
前端·数据可视化
slandarer1 天前
MATLAB | 泰勒图绘制,支持各种角度范围
开发语言·数学建模·matlab·nature·顶刊·泰勒图
RestCloud1 天前
什么是CDC数据同步?如何实现高效的数据实时传输
etl·数据处理·etlcloud·数据同步·数据集成平台·cdc数据同步·实时数据传输
那些年丶ny2 天前
颜色扩展库
前端·javascript·数据可视化
於 兔シ2 天前
Apache Superset 二次开发实践:接入 AI Agent,并确保数据权限不被绕过
ai·数据分析·agent·数据可视化·bi·superset·数据权限
2zcode3 天前
项目文档:基于MATLAB的肺结节自动分割与评估系统的设计与实现
人工智能·计算机视觉·matlab
2zcode3 天前
基于MATLAB深度学习的乳腺钼靶影像乳腺癌智能诊断系统设计与实现
开发语言·深度学习·matlab·乳腺癌