Scatter Plotting With Custom Markers?

9 次查看(过去 30 天)
Hello all,
I am trying the make a scatter plot that represents all 32 NFL teams comparing total yards gained vs total yards allowed. I also want the marker size to indicate the win percentage of each team. I was informed that the scatter() function can do that. However, I also need to represent each team with their logo as a custom marker. Is there a way to do that?
Thanks!!

采纳的回答

Walter Roberson
Walter Roberson 2023-3-1
Unfortunately, there is no support for custom markers in any Mathworks function that I can think of.
I seem to recall some File Exchange contributions that work with custom markers.
The general process is to describe the marker in terms of a patch() object centered around (0,0), and to copyobj() the patch adding the centre of the new location to the patch coordinates.

更多回答(1 个)

dpb
dpb 2023-3-1
编辑:dpb 2023-3-1
There's no way I'm aware of to use an image as a marker in a line or scatter object,
There's a <FEX submission> that will let you define a custom marker, but it uses patch which needs the vertices to draw a polygonal shape defined by coordinates vectors. That won't do for an image of a team logo.
; to do that you'll have to have an image to be able to put on an axes on top of a scatter object or limage that has a 'CData' property and use <image> to change the color data in the area around the X,Y coordinates, scaled to match the size. This will be no mean trick and, I'd think, it'll be hard to get an identifiable logo down to the few pixels you'll have to work with.
Research the content of the Image Processing toolbox, however; I don't have it so it may have something more suited to the purpose, but I think the last part above will still be a problem.
  3 个评论
Walter Roberson
Walter Roberson 2023-3-1
For images you can use surface() objects instead of patch() objects, and set texture mapping. Or use warp
... Or just image() the images into place specifying XData and YData... and probably being careful with the AlphaMask. Probably you would just create one representative object and copyobj() multiple times, setting the XData and YData to the new coordinates.
The image() approach requires more steps to rotate.
dpb
dpb 2023-3-2
"...Or just image() the images into place specifying XData and YData..."
That's what I was suggesting above, yes. However it's attempted, it's not going to be a trivial task methinks...

请先登录,再进行评论。

标签

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by