Merge scatterhists to one- Create

조회 수: 2 (최근 30일)
Ivan Mich
Ivan Mich 2020년 10월 29일
답변: Eric Sofen 2020년 11월 13일
Hello,
I would like to merge scatterhists into one. I am using the following code but the final scatterhist is only for the one of my data. I realised that I cannot use as I would like command hold on.
my code:
clc
clear
catalogue_SH=readtable('INPUT1.txt');
YSH=table2array(catalogue_SHALLOW(:,1));
MSH=table2array(catalogue_SHALLOW(:,6));
catalogue=readtable('INPUT2.txt');
YeH=table2array(catalogue_DEPTH(:,1));
MTH=table2array(catalogue_DEPTH(:,6));
scatterhist(YSH,MSH)
hold on
scatterhist(YeH,MTH)
could you please help me?
PS: I am uploading one example of what I would like to do in order to help you. I found it in the Internet. How can I plot something like this?

답변 (1개)

Eric Sofen
Eric Sofen 2020년 11월 13일
If you combine your SHALLOW and DEPTH data and add a simple grouping variable based on the height of SHALLOW and DEPTH, you can use the 'Group' parameter in scatterhist.
Something likes
group = [ones(size(YSH)); 2*ones(size(YeH))];
scatterhist([YSH;YeH],[MSH;MST],'Group', group)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by