当前位置:网站首页>Matlab paper illustration drawing template issue 39 - stairs
Matlab paper illustration drawing template issue 39 - stairs
2022-07-26 03:38:00 【A Kun's daily scientific research】
In the previous post , Shared Matlab Drawing template of line chart :

Three dimensional line chart Drawing template for :

As well as some Special line diagram :




This time I will share a kind of line diagram : Stairs .
Let's take a look first Finished product effect :


hot tip :Matlab Thesis illustration drawing template series , It aims to reduce the use of Matlab The threshold for scientific research mapping , Just add the corresponding content according to the template format , You can get data illustrations that meet the format requirements of most journals and dissertations . If you feel useful, you can share it with your friends .
The most critical part of the template :
1. Data preparation
This part is mainly Reading data , Define arguments 、 The dependent variable .
% Reading data% Define argumentsx = linspace(0,4*pi,30)';% Define the dependent variablesamp1 = 0.5*cos(x);samp2 = 1*cos(1.5*x);samp3 = 1.5*cos(0.5*x);samp4 = 1.5*cos(x);
2. Color definition
Color matching tests personal aesthetics , Need to try more .
here Directly use the previously shared colorplus Tools :
%% Color definitionC = colorplus([34 202 83 104]);C1 = C(1,:);C2 = C(2,:);C3 = C(3,:);C4 = C(4,:);

3. Ladder diagram drawing
Use ‘stairs’ command , draw A step map without beautification .
S1 = stairs(x, samp1);
S2 = stairs(x, samp2);
S3 = stairs(x, samp3);
S4 = stairs(x, samp4);
hXLabel = xlabel('Point spacing (m)');
hYLabel = ylabel('MAE (m)');4. Detail optimization
For the beauty of illustrations , Choose a good color before applying , And adjust other properties of the line .
% Define lineweight and color ( Or Linetype 、 Symbol 、 Lineweight and color )set(S1, 'LineWidth', 1.5, 'Color', C1)set(S2, 'LineWidth', 1.5, 'Color', C2)set(S3, 'LineWidth', 1.5, 'Color', C3)set(S4, 'LineWidth', 1.5, 'Color', C4)% set(S1, 'LineStyle', '-', 'Marker', '.', 'MarkerSize', 18, 'LineWidth', 1.5, 'Color', C1)% set(S2, 'LineStyle', '-', 'Marker', '*', 'LineWidth', 1.5, 'Color', C2)% set(S3, 'LineStyle', '-', 'Marker', 'o', 'LineWidth', 1.5, 'Color', C3)% set(S4, 'LineStyle', '-', 'Marker', 's', 'LineWidth', 1.5, 'Color', C4)
further , Adjust axis 、 Font size 、 Background color and other details :
% Axis beautificationset(gca, 'Box', 'off', ... % Frame'XGrid', 'off', 'YGrid', 'on', ... % grid'TickDir', 'out', 'TickLength', [.01 .01], ... % scale'XMinorTick', 'off', 'YMinorTick', 'off', ... % Small scale'XColor', [.1 .1 .1], 'YColor', [.1 .1 .1],... % Axis color'XTick', 0:2:14,...'XLim', [0 4*pi],...'YTick', -2:0.5:2, ...'YLim', [-1.7 2])ax2 = axes('Position',get(gca,'Position'),...'XAxisLocation','top',...'YAxisLocation','right',...'Color','none',...'XColor','k','YColor','k');set(ax2,'YTick', []);set(ax2,'XTick', []);box on% LegendhLegend = legend([S1,S2,S3,S4], ...'Samp1', 'Samp2','Samp3','Samp4', ...'Location', 'northeast',...'orientation','horizontal');% Font sizeset(gca, 'FontName', 'Arial', 'FontSize', 9)set([hXLabel,hYLabel,hLegend], 'FontName', 'Arial', 'FontSize', 10)% The background colorset(gcf,'Color',[1 1 1])
After setting up , With the resolution required by the journal 、 Format output picture .
%% Image outputfigW = figureWidth;figH = figureHeight;set(figureHandle,'PaperUnits',figureUnits);set(figureHandle,'PaperPosition',[0 0 figW figH]);fileout = 'test2';print(figureHandle,[fileout,'.png'],'-r300','-dpng');


above .
Complete code :
边栏推荐
- Navicat连接云端服务器上的MySQL数据库
- 多商户商城系统功能拆解15讲-平台端会员标签
- ext4、ntfs、xfs、btrfs、zfs、f2fs和reiserFS性能对比
- ELS modify cursor, modify Icon
- Completion report of communication software development and Application
- PHP连接mysql数据库,数据库连接静态工具类,简化连接。
- [STL]优先级队列priority_queue
- [experience sharing] strong recommendation - screenshot gadget FastStone capture (FSC)
- Why are more and more users of Bing search?
- 论文精读-YOLOv1:You Only Look Once:Unified, Real-Time Object Detection
猜你喜欢

Opencv error: (parameter or structure field)) unrecognized or unsupported array type in functon 'cvgetmat‘

Why did Mr. Cao, a productionist in the field of high-end tea, choose Ruifeng L6 max?

想要做好软件测试,可以先了解AST、SCA和渗透测试

LoRa无线网关如何快速实现端到云的传输
![[stl] priority queue priority_ queue](/img/79/d13913cbb9d98f936a9501633b38bf.png)
[stl] priority queue priority_ queue

Derivation of linear regression principle

文件上传报错:Current request is not a multipart request

【 Kotlin 中的类和对象实例】

TCP experimental verification
![[mathematical modeling - Summary of planning model] | matlab solution](/img/b0/a4d33d7d7b605b7cc6149b59b55fb8.png)
[mathematical modeling - Summary of planning model] | matlab solution
随机推荐
tf.truncated_ Normal() usage
Intensive reading of the paper -yolov1:you only look once:unified, real time object detection
Let Baidu collect, crawler own website
赶紧进来!!!用c语言基础知识几十行代码写一个猜数字小游戏
使用anaconda配置gpu版本的tensorflow(30系列以下显卡)
【 Kotlin 中的类和对象实例】
How Lora wireless gateway can quickly realize end-to-cloud transmission
Canvas -- draw text -- modification of pie chart
研发了 5 年的时序数据库,到底要解决什么问题?
LoRa和NB-IOT可用用在哪些地方
Sentinel vs Hystrix 到底怎么选?
tensorflow中tf.Variable()函数的用法
Graduation season & harvest season, leave your beautiful moments
ue4如何进行静态渲染?5个步骤生成静态渲染
Implement a method to find the sum of the number k and m in the array
Alibaba Sentinel - 集群流量控制
UE4 how to render statically? 5 steps to generate static rendering
Use Anaconda to configure the tensorflow of GPU Version (less than 30 series graphics cards)
LeetCode·
2020 AF-RCNN: An anchor-free convolutional neural network for multi-categoriesagricultural pest det