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

相关推荐
十三画者15 小时前
【文献分享】CANVAS:基于细胞构架与邻域信息的组织病理学虚拟空间肿瘤分析
人工智能·机器学习·数据挖掘·数据分析·数据可视化
凌云拓界15 小时前
NodeVerdict | 性能门禁:把追踪数据变成 CI 规则
ci/cd·信息可视化·开源·node.js·bug·数据可视化·安全架构
杨超越luckly17 小时前
Agent应用指南:巨幕之下 · 中国 IMAX 影院205城的空间布局
人工智能·arcgis·html·agent·数据可视化
netccdn19 小时前
Hough变换检测直线(Matlab)
开发语言·计算机视觉·matlab
做前端的娜娜子2 天前
从 0 到 1 打造一个配置可视化后台:一次前端配置中心化改造的实战复盘
前端·设计模式·数据可视化
DFT计算杂谈2 天前
ADV. SCI. 反铁磁体MnTe2中的Plaid-like自旋劈裂与手性磁振子
matlab
山海鲸可视化2 天前
数字孪生技术:创新性破解城市高温难题
大数据·运维·数字孪生·数据可视化·可视化大屏
机器学习之心3 天前
可拓理论+云模型:一套量化高校科研创新能力的MATLAB实现方案
matlab·云模型·可拓理论
bu_shuo3 天前
MATLAB中的meshgrid和ndgrid
开发语言·matlab
北墨NoLimit3 天前
TRAE Work实战:把办公Agent竞品调研从2-3天压到32分钟,有完整指令模板
前端·人工智能·数据可视化