gpt4 book ai didi

matlab - 单个冲浪图的多个轴

转载 作者:行者123 更新时间:2023-12-02 06:45:48 25 4
gpt4 key购买 nike

我有一个冲浪图,我希望其中有两个 y 轴。我似乎找不到任何其他类似的讨论。

到目前为止我得到的最接近的是:

surf(peaks);
view(0,0)
ax(1) = gca;
axPos = ax(1).Position;
ax(2) = axes('Position',axPos, 'Color', 'none','XTick',[],'ZTick',[],'YAxisLocation','right');
linkprop(ax, 'CameraPosition');
rotate3d on

最佳答案

% Desired plot
surf(peaks);

% Save axis
ax(1) = gca;

% Use the position of the first axis to define the new axis
pos = ax(1).Position;
pos2 = pos - [0.08 0 0 0];
ax(2) = axes('Position',pos2,'Color', 'none');

% Plot random line in 3D, just make sure your desired axis is correct
plot3(ones(length(peaks),1), 10:10:length(peaks)*10,...
ones(length(peaks),1), 'Color','none')

% Make plot, and non-desired axes, invisible
set(gca,'zcolor','none','xcolor','none','Color','none')

% Link axes
linkprop(ax, 'View');

关于matlab - 单个冲浪图的多个轴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36037556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com