Exclude a portion from a scatter plot

Can someone please suggest an efficient way to remove the more red part which is lying on the outer side of the yellow curve ?
This is a Xi2 vs Rigidity distribution (scatter plot) for some events. The axes are in log scale.
I need to introduce a function in this scatter plot to remove the outer yellow part from the whole plot.

댓글 수: 9

Dyuman Joshi
Dyuman Joshi 2023년 7월 26일
Have you tried using logical indexing to remove them or create a new array with values lower than the yellow curve?
Rivu
Rivu 2023년 7월 26일
편집: Rivu 2023년 7월 26일
Yes , but there are two main issues :
like if in the values I give xi2 < 1000 , a horizontal cut will be there and then some major portion of the blue dots (the good ones) gets excluded too. Which I do not want. I cant understand how to introduce a curve like that one in matlab and exclude the portion.
Dyuman Joshi
Dyuman Joshi 2023년 7월 26일
Do the indexing for the y values not the x values.
Rivu
Rivu 2023년 7월 26일
Here xi2 is in the y axis. I dont understand , please suggest something else.
Dyuman Joshi
Dyuman Joshi 2023년 7월 26일
How do you get the yellow line?
Can you attach the data for all 3 sets of points? (Red and blue points and yellow line)
Rivu
Rivu 2023년 7월 26일
I have drawn the curved yellow line over the curve just to make it more obvious as to what is needed
dpb
dpb 2023년 7월 26일
@Rivu, as others have already noted, without the data and the logic behind what are red and blue and what defines the yellow line location, nobody can do anything at all specific towards solving your problem.
The general solution has already been given, use logical addressing, but without something to work with, specifics aren't possible and it's expecting too much of the volunteers here to have them also have to make up illustrative datasets for fairly complicated problem for you..."help us help you!"
Rivu
Rivu 2023년 7월 26일
편집: Rivu 2023년 7월 26일
Okay, I apologise for the less information provided.
Here is the brief description of what the plot is : Using matlab , a selection criteria has been developed to distinguish between anti particles and particles. A data is generated when the program is processed. The data contains information about the Rigidity , DeDx , beta (velocity), xi2 etc of the particular particle.
An instance is depicted in the snap below ;
From the data obtained , the values are plotted in a scatter plot to visualize the distribution of Xi2 as a function of Rigidity(Rig) . The x and y axis have been plotted in log scale .
Here blue dots are values of particles and red dots are absolute values of antiparticles.
Now the main objective is to introduce a function in the code so as to exclude most of the antiparticles. From the plot it is observed that 97% of the antiparticles allign in the exterior diagonal portion of the distribution. So with that yellow line (which I have painted afterwards), I wanted to refer to the part of the plot which I want to exclude.
Therefore in a sentence , I want a suggestion as to how to exclude a diagonal portion of a log log scatter plot using Matlab.
I hope I was able to make some sense.
dpb
dpb 2023년 7월 27일
Attach a .mat file with the data, not just images; nothing can be done with them but look...even better would be to add the code to generate the present figure (w/o the line is ok).

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품

태그

질문:

2023년 7월 26일

댓글:

dpb
2023년 7월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by