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

相关推荐
xmyLydia2 小时前
🚀 封装通用线程池 + Prometheus 可视化任务耗时与成功率(实战记录)
kafka·数据可视化
The hopes of the whole village5 小时前
matlab 绘图
开发语言·matlab·信息可视化
程高兴15 小时前
基于Matlab的车牌识别系统
开发语言·matlab
图表制作解说(目标1000个图表)16 小时前
ECharts散点图-散点图15,附视频讲解与代码下载
echarts·统计分析·数据可视化·散点图·大屏可视化
XuX0318 小时前
手搓雷达图(MATLAB)
matlab·贴图
databook20 小时前
『Plotly实战指南』--样式定制高级篇
python·数据分析·数据可视化
freexyn21 小时前
Matlab自学笔记五十一:(推荐)输入参数的数量和可变数量的输入
笔记·算法·matlab
不吃酸的柠檬1 天前
MATLAB 中的图形绘制
人工智能·机器学习·matlab
studyer_domi1 天前
Matlab 复合模糊PID
开发语言·matlab
Mapmost1 天前
【数据可视化艺术·应用篇】三维管线分析如何重构城市"生命线"管理?
前端·数据可视化