Scatter plot with multiple markers

你离开我真会死。 提交于 2019-12-05 22:11:24
bla

There shouldn't be a problem to use scatter and show different markers. For example:

load seamount
scatter(x,y,30,z,'s'); hold on
scatter(.999*x,1.001*y,30,z,'x'); hold on
scatter(1.001*x,.999*y,30,z,'+'); hold on

I suspect that you had a typo and used - as a marker type. The marker types you can use are :

  • '+' Plus sign
  • 'o' Circle
  • '*' Asterisk
  • '.' Point
  • 'x' Cross
  • 'square' or 's' Square
  • 'diamond' or 'd' Diamond
  • '^' Upward-pointing triangle
  • 'v' Downward-pointing triangle
  • '>' Right-pointing triangle
  • '<' Left-pointing triangle
  • 'pentagram' or 'p' Five-pointed star (pentagram)
  • 'hexagram' or 'h' Six-pointed star (hexagram)
user3437983

Just to add that you don't have to write 'hold on' for each line. Once will be sufficient. So, for this you can write:

load seamount
scatter(x,y,30,z,'s'); hold on
scatter(.999*x,1.001*y,30,z,'x'); 
scatter(1.001*x,.999*y,30,z,'+'); 

Also, if you wanna draw a new set of data and clean the previous, you need to write 'hold off' once before doing this command.

The scattergroup property name is 'marker'

Check in doc 'Scattergroup Properties'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!