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

相关推荐
我找到地球的支点啦4 小时前
Matlab系列(009) 一CRC循环冗余校验详解
开发语言·数据结构·算法·matlab·信息与通信
Highcharts12 小时前
针对 React 和 Vue 技术栈,推荐Highcharts可视化图表库及封装方案
数据可视化
Highcharts12 小时前
Highcharts创建深度图表示列
数据可视化
一晌小贪欢13 小时前
python-第15天:Python 列表推导式
开发语言·python·excel·数据可视化·python办公
Highcharts.js13 小时前
数据赋能智造|可视化在制造业工业物联网系统中的落地实践——Highcharts数据可视化图表开发工具应用
物联网·信息可视化·数据可视化
Patrick在香港15 小时前
Python 拉取 C&SD 官方 API:香港 2022 年已跨过“超老龄线“,而抚养比正在爬回 1961
android·c语言·python·数据分析·时序数据库·数据可视化·香港
躺柒2 天前
读数据可视化19层次数据
信息可视化·数据挖掘·数据分析·数据可视化·层次数据·层次结构
吃好睡好便好3 天前
查找函数的使用
学习·算法·matlab·生活·查找函数
Patrick在香港3 天前
Python 拉取城巴开放数据:406 条路线,香港岛巴士网络的数字画像
网络·python·数据分析·php·数据可视化·香港·开放数据
chhttty3 天前
Design Verifier检查:整型数溢出检查与修复
matlab·simulink