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

相关推荐
周庆猛3 小时前
Babylon.js 多灯场景在 Windows 上报错:VERTEX shader uniform block count exceeds GL_MAX_VE
前端·数据可视化
一晌小贪欢3 小时前
第26节:自动化办公——利用 Python 自动生成动态分析报告 (PPT/PDF)
开发语言·python·数据分析·自动化·powerpoint·pandas·数据可视化
山海鲸实战案例分享4 小时前
【数字孪生实战案例】怎样为二维孪生组件新增测绘功能?~山海鲸可视化
数字孪生·数据可视化·零代码·测绘·实战案例·山海鲸可视化·二维孪生
小哈机器人9 小时前
Phantom Bridge:一个基于WebRTC的ROS2远程可视化与遥操作工具
机器人·webrtc·数据可视化
KWTXX1 天前
测试工具-论文 MATLAB 仿真复现【成功】
开发语言·matlab
jllllyuz1 天前
MATLAB实现滚动轴承故障诊断(外圈故障)
开发语言·人工智能·matlab
slandarer1 天前
MATLAB | 韦恩图的高阶版: UpSet图 更新升级啦!
开发语言·matlab
南檐巷上学1 天前
基于改进型CNN神经网络的车牌定位识别系统(Matlab)
人工智能·神经网络·matlab·cnn·车牌识别·vgg
cici158741 天前
基于Matlab的数字全息相位展开及再现实现
开发语言·matlab
极光代码工作室1 天前
基于数据分析的电影票房预测系统
大数据·python·数据分析·spark·数据可视化