(10*x); figure [hAx,hLine1,hLine2] = plotyy(x,y1,x,y2,'plot','stem') hLine1.LineStyle = '--'; hLine2.LineStyle = ':'; title('Multiple Decay Rates') xlabel('Time (\musec)') ylabel(hAx(1),'Slow Decay') % left y-a
x = linspace(0,10); y = sin(3*x); yyaxis left plot(x,y); xlabel('x'); ylabel('y1'...
I would like to create a log plot with a common log x axis, but the left y axis for trace 1 to be log, and the right axis for trace 2 to be linear (no-log). How would I go about doing this? 댓글 수: 0 댓글을 달려면 로그인하십시오. 이 질...
1 plotyy(X1,Y1,X2,Y2)在左侧绘制X1与Y1之间的关系,左侧标记y轴;右在侧绘制X2与Y2之间的关系,右侧标记y轴。For example,plotyy(x1,y1,x2,y2,@loglog) % function handleplotyy(x1,y1,x2,y2,'loglog') % stringplotyy(X1,Y1,X2,Y2,'function1','functi...
You will still need multiple axis, as the tick labels apply to the whole axis. You should, however, not need to actually plot anything in the second axis, as you can set the axis ylim to the range you need. It is probably easiest to still use plotyy() to set things up. You can...
*sin(x); y2 = 0.8*exp(-0.5*x).*sin(10*x); [AX,H1,H2] = plotyy(x,y1,x,y2,'plot'); set(AX(1),'XColor','k','YColor','b'); set(AX(2),'XColor','k','YColor','r'); HH1=get(AX(1),'Ylabel'); set(HH1,'String','Left Y-axis'); set(HH1,'color','b');...
plot(t,y,'r','LineWidth',1.5 ); %画图,t是横坐标,y是纵坐标,属性 lineWidth的值是1.5(即线宽度为1.5), 颜色为红色(手动指定) title('y随t的变化图'); %图名 xlabel('t'); %横坐标轴名 ylabel('y = cos(t)*k '); %纵坐标轴名 ...
实例一:多子图、命令plot、图形标识(图名和横纵坐标)演示 多子图:subplot (m,n,k)一个窗口划分成mn个小块,每个小块存放一个子图,k是子图的编号。 编号规则是: 从左到右边,从上到下依次编号。 %%定义函数 t= (0:pi/50:2*pi)'; % 列向量 101*1k = (0.4:0.1:1); % 行向量1*7y= cos(t)...
0.8*exp(-0.5*x).*sin(10*x);figure % newfigure[hAx,hLine1,hLine2] = plotyy(x,y1,x,y2);title('Multiple Decay Rates')xlabel('Time (\musec)')ylabel(hAx(1),'Slow Decay') % left y-axisylabel(hAx(2),'Fast Decay') % right y-axis ...
Plot two data sets using a graph with twoy-axes. Add a title and axis labels. x = 0:0.01:20; y1 = 200*exp(-0.05*x).*sin(x); y2 = 0.8*exp(-0.5*x).*sin(10*x); figure [hAx,hLine1,hLine2] = plotyy(x,y1,x,y2); title("Multiple Decay Rates") xlabel("Time (\musec...