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

相关推荐
极光代码工作室40 分钟前
基于Spark的日志监控与分析平台
大数据·hadoop·python·spark·数据可视化
YouGIS顽石工坊2 小时前
Python GDAL实战:ASTER GDEM V003全国DEM高程数据处理(1123幅分幅合并→34省裁切,30m精度)
gis·遥感·dem·数据处理·空间数据库·数字高程模型·aster gdem
databook18 小时前
当散点图不够用时:用 t-SNE 可视化多维数据
python·数据分析·数据可视化
Strayer1 天前
拓扑管网 3D 可视化大屏demo:科技感(地图 + 拓扑 + 3D 空间)
前端·three.js·数据可视化
其美杰布-富贵-李1 天前
MATLAB 中英文混排-Tex解释器
matlab
2zcode1 天前
基于MATLAB深度卷积特征的多曝光图像自适应融合系统设计与实现
开发语言·matlab·多曝光图像自适应融合系统
datagear1 天前
DataGear 6.0.0 新特性之本地图表
数据分析·html·数据可视化
钟山翼1 天前
notepad++ 使用 HexEditor 显示二进制 bin 文件存在的 bug
matlab·二进制文件
晁阳2 天前
Three.js 带主题切换的数据可视化大屏 —— 技巧与实现
数据可视化
2zcode2 天前
项目文档:基于MATLAB图像处理与FCM聚类的骨癌X射线影像辅助检测系统设计与实现
图像处理·matlab·聚类