How to insert a third axis to plot additional data?

1 view (last 30 days)
Hello gurus, what I'd like to achieve (or, better, what my boss would like me to achieve) is a bit uncommon.
I'm scatter plotting some data on a specific background originated by this chunk of code:
figure
hold on
accv = (0:5:350); % [g]
rotv = (0:1:70); % [rad/s]
[acc, rot] = meshgrid(accv,rotv);
ex = exp(-(-10.2 + 0.0433.*acc + 0.19686*rot - 0.0002075*acc.*rot));
R = 1./(1+ex);
[~, plotvec] = contourf(accv, rotv, R);
hex1 = ['#f8f8f9';'#e7e8e9';'#cecfd1';'#bdbfc2';'#a3a6aa';'#92969b';...
'#797d83';'#56595d';'#525559';'#2e3032';'#2b2c2e']; % 11 SHADES OF GREY
map1 = sscanf(hex1','#%2x%2x%2x',[3,size(hex1,1)]).'/255; % HEX TO RGB
colormap(map1);
What I now need to do is to add a third axis to this plot, that I'll use to display something (i.e., boxplot) using a different set of data (related to the previous one). This (or something close) should be the result:
Thanks in advance for any help you can provide.

Answers (1)

Sivani Pentapati
Sivani Pentapati on 2 Dec 2021
Based on my understanding, you want to add an axis to an existing plot in order to display two different plots together which share a common axis. One workaround would be to plot these two as as two subplots in a same row, as they would then have a common vertical axis, which can be used for proper interpretation. Another workaround would be to use plot3 function and plot your data in YZ plane and XZ plane, where they would share a common Z Axis, similar to the image which you have posted.

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by