user001
user001

Reputation: 1848

Sparsity pattern MarkerFaceColor

The MATLAB function spy uses the point (.) as the default plot marker. This has the disadvantage of unresponsiveness to MarkerSize at values less than 5 (i.e., MarkerSize=1 is identical to MarkerSize=4). Therefore, I am plotting spy using the plot symbol o (circle) instead of . (point) because the size of the former can be tuned to sizes in the range 1-4.

spy(bucky,'o',3)

The problem is that MarkerFaceColor cannot be set in the LineSpec properties (to my knowledge), so the result is open circles. Moreover, spy does not return an argument such as an object handle. Therefore, changing the marker face color by set(handle,'MarkerFaceColor','color') does not work.

Is there a way to set the MarkerFaceColor of spy plot symbols?

Upvotes: 1

Views: 1488

Answers (1)

Jonas
Jonas

Reputation: 74940

You can use findall to query the handle to the blue markers and then set the MarkerFaceColor property:

spy(bucky,'o',3)
markerH = findall(gca,'color','b');
set(markerH,'MarkerFaceColor','r');

Upvotes: 2

Related Questions