Legend and scaled plot

조회 수: 2 (최근 30일)
Perez Danny
Perez Danny 2021년 4월 6일
댓글: Star Strider 2021년 4월 7일
Hello community
I am trying to plot earthquakes. I would like to plot them using circles, which size is scaled with their magnitude and at the same time I would like to color them regarding the value of the depth. And, I want to represent them in the legend. Like the adjoint image.
I was trying with scatter, it works, if I do a "scaling/normalization" to the magnitude and then I can fill the circles with a color based on depth, but I do not know how to show the legend using the size of circles.
Another idea that I saw on this forum was the use of index, they scale perfectly the size of the circle, but how can I color them? and how can I plot the size of the circles on the legend?
Please, If someone has any suggestion or comment I would like to hear
Thanks

채택된 답변

Star Strider
Star Strider 2021년 4월 6일
The third argument to scatter will vary the circle sizes according to whatever variable vector is specified, and the fourth argument the colours.
I do not have the Mapping Toolbox, however the scatterm function may be best in that context.
  댓글 수: 4
Perez Danny
Perez Danny 2021년 4월 6일
That approximation is also nice, and easier to understand.
Thanks so much for your time and assistance
Star Strider
Star Strider 2021년 4월 7일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by