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重写默认值对象.下载该插件翻译源码 滑动条允许用户从一个有限的范围内选择一个数值.当滑块控件沿着轨道移动的时候,将会显示一个提示来表示当前值.用户可以 ...
随机推荐
- PHP设计模式
设计模式总的分为三种,创建型模式.结构性模式.行为型模式 1.创建型模式 创建型模式为根据实际情况来创建对象,创建的模式又分为对象创建模式和类创建模式,对象创建模式会把对象创建的一部分在另一个对象中实 ...
- [JS复习] JS 基础知识
项目结尾,空闲时间,又把<JS 基础知识> 这本书过了一遍,温故知新后,很多知其然不知其所以然的内容 豁然开朗. [1. 用于范围的标签] display :inline or bloc ...
- HTML5 Canvas一些常用的操作
粗略的Canvas API 1. context var context = canvas.getContext('2d'); 2.Canvas state context.save();//将当前状 ...
- js时间处理
// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 // (new Dat ...
- JS控制TABLE表格在任意一行下面添加一行(有待完善)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Synchronized快
/* JAVA对于多线程的安全问题提供了专业的解决方式 就是同步代码块 synchronized(对象)//这个对象可以为任意对象 { 需要被同步的代码 } 对象如同锁,持有锁的线程可以在同步中执行 ...
- 抓包工具--Fiddler及charles的使用
Fiddler和charles--是抓包工具,可以抓到pc端的请求,手机上设置代理后也可以抓到手机上的请求,也可以修改请求数据和返回的数据. 1.网页抓包,打开Fiddler或Charles应用直接访 ...
- 【Yeoman】热部署web前端开发环境
本文来自 “简时空”:<[Yeoman]热部署web前端开发环境>(自动同步导入到博客园) 1.序言 记得去年的暑假看RequireJS的时候,曾少不更事般地惊为前端利器,写了<Sp ...
- Spring MVC错误页面配置
当前SpringMVC非常流行,在大多数情况,我们都需要自定义一些错误页面(例如:401, 402, 403, 500...),以便更友好的提示.对于spring mvc,这些当然是支持自定义的,sp ...
- Berkeley DB的数据存储结构——哈希表(Hash Table)、B树(BTree)、队列(Queue)、记录号(Recno)
Berkeley DB的数据存储结构 BDB支持四种数据存储结构及相应算法,官方称为访问方法(Access Method),分别是哈希表(Hash Table).B树(BTree).队列(Queue) ...