Matlab_Graphics(1)_2D
1.Add title ,axis Lables, and Legend to Graph:
x=linspace(-*pi,2pi,);
y1=sin(x);
y2=cos(x);
figure
plot(x,y1,x,y2);
title('Graph of sine and cosine between -2\pi and 2\pi');% to display Greek symbols in a title,use the tex markup '\'
xlabel('-2\pi<x<2\pi'); % x-axis label
ylabel('sine and cosine value');% y-axis label
legend('y=sin(x)','y=cos(x)'); % add legend
2.change Graph axis Limits functions:
Axis function: Axis([xmin,xmax,ymin,ymax]); or xlim([xmin,xmax])/ylim([ymin,ymax])/zlim([zmin,zmax])
3.Change Tick Marks and Tick Labels of Graph:
x=linspace(-,,);
y=cos(x);
figure
plot(x,y)
h=gca; % Use gca to get the handle for the current axes
h.XTick=[-*pi,-*pi,-pi,,pi,*pi,*pi];
h.YTick=[-,-0.5,,,,]; % Change the location of the tick marks on the plot
% by setting the XTick and YTick properties of the
% axes.
h.XTickLabel={'-3pi','-2pi','-pi','','pi','2pi','3pi'};
h.YTickLabel={'min=1','-0.5','','0.5','max=1'};
Specify tick mark labels by setting the XTickLabel and YTickLabel porperties of the axes, Set these properties using
a cell array of string with the desired labels .If you do not specify enough text labels for all the tick marks,then
MATLAB cycles through the labels.
4. grid on : to display the major grid lines, The grid on command sets the XGrid,YGrid,and ZGrid axes prperties.
5. grid minor: to display the minor grid lines,The grid minor command sets the XMinorGrid/YMinorGrid, and ZMinorGrid properties.
6. grid off : to remove the grid lines,
7.Display Grid Lines in Single Direction:
x=-10:10;
y=x.^2;
figure
plot(x, y);
ax=gca;
ax.XGrid='on'; % setting the XGrid axes property to 'on ' and the YGrid axes property to 'off'
ax.YGrid='off';
ax.XMinorGrid='on'; % setting the XGridMinor axes property to 'on ' and the YGridMinor axes
ax.YMinorGrid='off'; % property to 'off'
8.Change Grid Line Style:
x=-10:10
y=x.^2;
figure
plot(x,y)
grid on
grid minor
ax=gca;
ax.GridLineStyle='-'; %change the grid line style using the GridLineStyle and
ax.MinorGridLineStyle='-'; %MinorGridLineStyle axes properties.
9.hold on: retain the line plot and add a new plot to the graph.
10.hold off: to reset the hold state so that new plots replace existing plot,which is the default behavior.
11.Create Graph with Two y-Axes:
A=;
a=0.005;
b=0.005;
t=:;
Z1=A*exp(-a*t);
Z2=sin(b*t);
[ax,p1,p2]=plotyy(t,Z1,t,Z2,'semilogy','plot');
ylabel(ax(),'Semilog Plot');
ylabel(ax(),'Linear Plot');
xlabel(ax(),'Time');
p1.LineStyle='--';
p1.LineWidth=;
p2.Linewidth=;
grid(ax(),'on');
grid(ax(),'on');
12.Display Markers at Specific Data Points on line Graph:
x=linspace(0,2*pi,100);
y=sin(x);
xmarkers=0:pi/2:2*pi;
ymarkers=sin(xmarkers);
figure
plot(x,y,'b',xmarkers,ymarkers,'b*');
Matlab_Graphics(1)_2D的更多相关文章
- 安卓自定义view_GDI绘图 _2d绘图_canvas绘图
2014年到2016年 发生了很多事情,如今已成定局,现在想忘掉这些烦恼的事情,找点以前想干没有干的事情来做,塞满大脑就不去想了. 之前,一直想做一款挂机类游戏,各种平台和开发语言都选择过了,从htm ...
- 移动开发day1_过渡_2d转换_3d立体
今天是就业班开班的第一天,上完了一天的课,做点总结. 什么叫做移动web 专门在手机或者 平板电脑 浏览器网页 为什么要学习移动web 工资高 1. 人拥有的手机数 大于 电脑的个数 2. 微信 1. ...
- CSS3_过渡_2D 变换_瓶体旋转_动态时钟
1. 过渡 transition 允许 CSS 的属性值在一定时间内平滑的过渡, 在鼠标点击,鼠标滑过或对属性改变中触发,并圆滑的改变 CSS 的属性值 简写属性: #box { width: 300 ...
- Unity ShaderLab学习总结
http://www.jianshu.com/p/7b9498e58659 Unity ShaderLab学习总结 Why Bothers? 为什么已经有ShaderForge这种可视化Shader编 ...
- 根据屏幕的宽度使用不同的css-文件
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- Cocos2d-X3.0 刨根问底(三)----- Director类源码分析
上一章我们完整的跟了一遍HelloWorld的源码,了解了Cocos2d-x的启动流程.其中Director这个类贯穿了整个Application程序,这章随小鱼一起把这个类分析透彻. 小鱼的阅读源码 ...
- Jquery easyui的validatebox控件和正则表达式
http://blog.csdn.net/dandanzmc/article/details/36421465 仔细观察jquery.validatebox.js文件,会发现它的验证其实还是采用的正则 ...
- easyui源码翻译1.32--ValidateBox(验证框)
前言 使用$.fn.validatebox.defaults重写默认值对象.下载该插件翻译源码 validatebox(验证框)的设计目的是为了验证输入的表单字段是否有效.如果用户输入了无效的值,它将 ...
- easyui源码翻译1.32--Slider(滑动条)
前言 使用$.fn.slider.defaults重写默认值对象.下载该插件翻译源码 滑动条允许用户从一个有限的范围内选择一个数值.当滑块控件沿着轨道移动的时候,将会显示一个提示来表示当前值.用户可以 ...
随机推荐
- JAVA 1.3 (原生数据类型 Primitive Data Type)续
1. 原生数据类型一共有4类8种 >> 整数类型 int表示一个int代表32位 2^32(-2147483648 - 2147483647) >> 字符类型 byte 表示一 ...
- X.509,RSA,PKCS 普及
X.509 X.509是一种非常通用的证书格式.所有的证书都符合ITU-T X.509国际标准,因此(理论上)为一种应用创建的证书可以用于任何其他符合X.509标准的应用. 在一份证书中,必须证明公钥 ...
- eclipse导入android项目红叉和红色感叹号怎么解决
解决办法如下:第一步:你要确保这个项目没有问题,有的项目本身就有问题,例如:xml文件,java程序等本身就有错.第二步:在Eclipse菜单中选择“Project”----〉Clean 解决不了,下 ...
- viewPager 的可滑动 Title
有三种方式: 1. 系统提供的title 缺点:标题在viewpager的滑动过程中也会滑动 实现:在ViewPager布局中添加 PagerTabStrip 或者是 PagerTitleStrip ...
- 《爵迹》侵权链接多为个人用户分享到个人网盘 总结说明:推广途径为 网盘>微博>博客>贴吧>知道
网络侵权链接3318条.该片的侵权范围分布相对较均匀,其中微博/博客侵权链接630条.占比19%:贴吧778条.占比23.4%:知道513条.占比15.4%:网盘828条.占比25%:小网站410条. ...
- jQuery 表格删除,添加行
var colsNum = 4; 1,$(document),ready(function () { $.("#id1").parent().after('<tr class ...
- ireport5.6+jasperreport6.3开发(二)--web开发的配置
ireport5.6只能编译出*.jasper的报表包,最终报表需要被输出为一个doc html pdf excel等文件,这时就需要jasperreport6.5的库进行配合了. jasperrep ...
- javascript实现登录验证码
1.js var code="" ; //在全局 定义验证码 function createCode(){ code = ""; ;//验证码的长度 var c ...
- Javascript中apply、call、bind
网上文章虽多,大多复制粘贴,且晦涩难懂,我希望能够通过这篇文章,能够清晰的提升对apply.call.bind的认识,并且列出一些它们的妙用加深记忆. apply.call 在 javascript ...
- 20169212《Linux内核原理与分析》课程总结
20169212<Linux内核原理与分析>课程总结 每周作业链接汇总 第一周作业:完成linux基础入门实验,了解一些基础的命令操作. 第二周作业:学习MOOC课程--计算机是如何工作的 ...