码迷,mamicode.com
首页 > 其他好文 > 详细

matlab双坐标轴设定

时间:2015-07-12 00:03:46      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:

clc;
clear all;
close all;
技术分享
x1 = 0:.1:40;
y1 = 4 * cos(x1)./(x1 + 2);
x2 = 1:.2:20;
y2 = x2.^2 ./ x2.^3;

h11 = line(x1,y1,‘Color‘,‘r‘);
ax1 = gca;
aa = get(ax1,‘position‘);
aa(1:2) = aa(1:2) + .1;
aa(3:end) = aa(3:end) - .2;
% aa(1:2) = aa(1:2)+1
set(ax1,‘XColor‘,‘r‘,‘YColor‘,‘r‘);
ax2 = axes(‘position‘,aa,...
            ‘XAxisLocation‘,‘bottom‘,...
            ‘YAxisLocation‘,‘left‘,...
            ‘Color‘,‘none‘,...
            ‘XColor‘,‘k‘,‘YColor‘,‘k‘);
h12 = line(x2,y2,‘Color‘,‘k‘,‘Parent‘,ax2);

  

matlab双坐标轴设定

标签:

原文地址:http://www.cnblogs.com/Kermit-Li/p/4639568.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!