当前位置:网站首页>matlab drawing
matlab drawing
2022-08-04 21:05:00 【Lin Dexi】
This article describes how to use matlab to draw.This article includes: line chart x-axis and y-axis, title, legend Column chart fill pattern
Line Chart
How does matlab set the distance between the legend and the x-axis of the graph in the next section
The legend of the line chart needs to know the Legend, which can be set using him
legend(...,'Location',LOC) adds alegend in the specifiedlocation, LOC, with respect to the axes. LOC may be either a1x4 position vector or one of the following strings:'North' inside plot box near top'South' inside bottom'East' inside right'West' inside left'NorthEast' inside top right (default for 2-D plots)'NorthWest' inside top left'SouthEast' inside bottom right'SouthWest' inside bottom left'NorthOutside' outside plot box near top'SouthOutside' outside bottom'EastOutside' outside right'WestOutside' outside left'NorthEastOutside' outside top right (default for 3-D plots)'NorthWestOutside' outside top left'SouthEastOutside' outside bottom right'SouthWestOutside' outside bottom left'Best' least conflict with data in plot'BestOutside' least unused space outside plot
How to set the x-axis size?
It can be set by set(gca,'xtick',1:1:100);
code setting starts from 1 and ends at 100, explain
set(gca,'xtick',start:between two dots:end);
Histogram
How to draw a bar chart and how to fill the bar chart with different patterns?
Matlab histogram fill pattern can be drawn using applyhatch, the following will tell you how to do it
The first step is to copy the file applyhatch.m
to your computer.About where to download applyhatch.m
, please Baidu, if you can't find it, you can contact me at [email protected]
Don't tell in herenext
The second step is to copy the file to the workbench. What is the workbench is the folder path opened by the software. The path is as shown below
You can modify it yourself, just put the above files in this folder.
The usage is applyhatch(gcf,'\.x.');
The second parameter is to use a different pattern, you can add '/', '\', '|', '-', '+', 'x', '.'
several characters
Example:
close allclear allclc% The computer journal paper% Jigang Wu etc.% copyright: [email protected]% data = [31,32,35;72,73,75;113,114,117;144,146,147;171,173,174;213,215,220];data =[16,17,18;33,34,37;51,54,55;71,74,74;86,91,91;105,113,113];bar(data,1);axis([0 7 0.0 150]);legend('DPA','TSRP','GRP',0);grid on;set(gca,'XTickLabel',{'100','200','300','400','500','600'});xlabel('The number of internal nodes');ylabel('The number of replica that created');set(gcf,'Color','w'); % Set the background color to white, otherwise the color of the area where the coordinate axis appears is grayapplyhatch(gcf,'\.x.');
For different combinations of histograms, use data=[data 1.1, data 1.2, data 1.3; data 2.1, data 2.2...]
Then draw it, use bar(data,1);
The second parameter is the width, try to modify the second value and run it.
The legend can be used. The legend of matlab uses legend('DPA','TSRP','GRP',0);
to add the corresponding legend as much as there is data.
Try the following code:
y=[559006 ,2269384,783762;508559 ,2140905,696001;506491,2007763,735464]bar(y,0.6)legend('n','N','l')grid on;set(gca,'XTickLabel',{'first','second','third'})xlabel('Number of matches')ylabel('Number of results')set (gcf,'Position',[500,500,500,500],'color','w')applyhatch(gcf,'\.x./');set(gcf,'Color','w');
If you encounter problems with the process, you can contact me.
Thanks to Brother Chen Long for his help.
边栏推荐
- Big capital has begun to flee the crypto space?
- visual studio 2015 warning MSB3246
- moke、动态图片资源打包显示
- 链栈的应用
- How to make good use of builder mode
- 嵌入式分享合集28
- mdk5.14无法烧录
- 【1403. 非递增顺序的最小子序列】
- Zero-knowledge proof notes - private transaction, pederson, interval proof, proof of ownership
- After encountering MapStruct, the conversion between PO, DTO and VO objects is no longer handwritten
猜你喜欢
How to understand the crawler's Scrapy framework in the simplest and most popular way?
使用百度EasyDL实现森林火灾预警识别
某男子因用本地虚拟机做压测,惨遭字节面试官当场嘲笑
PowerCLi 批量配置NTP
DICOM医学影像协议
88. (the home of cesium) cesium polymerization figure
c语言小项目(三子棋游戏实现)
【学术相关】清华教授发文劝退读博:我见过太多博士生精神崩溃、心态失衡、身体垮掉、一事无成!...
1、File对象学习
【一起学Rust | 进阶篇 | Service Manager库】Rust专用跨平台服务管理库
随机推荐
dotnet enables JIT multi-core compilation to improve startup performance
香港暂停进口俄罗斯部分地区禽肉及禽类产品
88. (the home of cesium) cesium polymerization figure
工龄10年的测试员从大厂“裸辞”后...
常用正则表达式[通俗易懂]
如何用好建造者模式
[2022 Hangzhou Electric Multi-School 5 1003 Slipper] Multiple Super Source Points + Shortest Path
【debug】postgres数据存储错乱
web漏洞扫描器-awvs
帝国CMS仿核弹头H5小游戏模板/92game帝国CMS内核仿游戏网整站源码
win10 uwp modify picture quality compress picture
PowerCLi 批量配置NTP
Debug locally and start the local server in vs code
实战:10 种实现延迟任务的方法,附代码!
用 Excel 爬取网络数据的四个小案例
1、File对象学习
模拟对抗之红队免杀开发实践
【2022牛客多校5 A题 Don‘t Starve】DP
After the tester with 10 years of service "naked resignation" from the big factory...
Win10 uwp use ScaleTransform magnify an element