Can MATLAB plot a graph like this? (Ignore the black lines and light blue areas; I only care about the red and blue points.)

조회 수: 1 (최근 30일)
Hello everyone, I want to plot the image below. Please ignore the other parts; I'm mainly focused on the red and blue points. I know the scatter function can plot points of different sizes, but the issue is with the red legend next to it. Can MATLAB generate a legend like this, reflecting the size of the points? Looking forward to any responses.

채택된 답변

Cris LaPierre
Cris LaPierre 2024년 12월 3일
This is a bubble chart. You can create this in MATLAB using bubblechart
The legend isn't exactly the same, but conveys the relationship between size and value.
  댓글 수: 4
Cris LaPierre
Cris LaPierre 2024년 12월 4일
Here's perhaps a slightly cleaner way.
% create dummy data
t = 0:0.1:10;
y = sin(t);
sz = (y+1)*50;
tiledlayout(1,11)
nexttile([1 10])
scatter(t,y,sz);
ax = nexttile;
scatter(0,1:100,1:100,'r')
ylabel('log_{10}Q')
ax.YAxisLocation = 'right';
xticks([])
% Customimze the displayed size (may not be necessary)
yticks(0:20:100)
yticklabels(0:2:10)

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

추가 답변 (1개)

Image Analyst
Image Analyst 2024년 12월 4일
Instead of bubble chart, try scatter where you can specify the color and size of each marker.

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by