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

相关推荐
柳杉6 小时前
使用AI从零打造炫酷的智慧城市大屏(开源):React + Recharts 实战分享
前端·javascript·数据可视化
凌云拓界12 小时前
TypeWell全攻略:AI健康教练+实时热力图开发实战 引言
前端·人工智能·后端·python·交互·pyqt·数据可视化
谁不学习揍谁!13 小时前
基于python大数据机器学习旅游数据分析可视化推荐系统(完整系统+开发文档+部署教程+文档等资料)
大数据·python·算法·机器学习·数据分析·旅游·数据可视化
dracula0001 天前
Simulink建模助手系列-7【根据From创建Bus Creator】
matlab
长路 ㅤ   2 天前
Guava工具类库使用
数据处理·java集合·guava工具类·lists.partition·hashbasedtable·immutableset
dracula0002 天前
Simulink建模助手系列-进阶2【解析Bus总线信号层次结构】
matlab
@陈小鱼2 天前
基于 Savitzky-Golay滤波器的超声图像运动分析方法
python·计算机视觉·matlab·信号处理
-To be number.wan3 天前
用 Pandas 分析自行车租赁数据:从时间序列到天气影响的完整实训
python·数据分析·pandas·数据可视化
guygg883 天前
基于人工神经网络的彩色图像恢复 MATLAB实现
开发语言·计算机视觉·matlab