How to fill circles with differentiated shapes (an x, dashed lines), etc.

Hi all! I am plotting something with a bunch of colored circles and would like to fill certain circles with say an x, or dashed lines, or shading to differentiate certain types from others. I haven't been able to find a way to do this. I know about MarkerFaceColor, but that will really only fill it and I'm looking for something more subtle. Thanks!
Below is a rough example of what I have.

 Accepted Answer

You can overplot them with ‘+’, ‘.’, ‘x’ or overplot or use other symbols such as stars ‘p’.

5 Comments

What is overplotting? How do I do that? Just make an identical plot line with the shape I want? Thanks!
For instance, I have this in my attempt to overplot but it doesn't seem to work:
plot(qthres(STi),peakamp(STi), 'ko', 'MarkerSize', 10, 'LineWidth', 1.5);
plot(qthres(STi),peakamp(STi), 'kx', 'MarkerSize', 10, 'LineWidth', 1.5);
hold on;
plot(qthres(SMi),peakamp(SMi), 'ko', 'MarkerSize', 10,'LineWidth', 1.5);
plot(qthres(SMi),peakamp(SMi), 'k-', 'MarkerSize', 10,'LineWidth', 1.5);
plot(qthres(SVi),peakamp(SVi), 'ko', 'MarkerSize', 10,'LineWidth', 1.5);
plot(qthres(SVi),peakamp(SVi), 'k+', 'MarkerSize', 10,'LineWidth', 1.5);
I can’t run your code, since I don’t have your data.
I was thinking of something like this:
x = randi([1 9], 1, 10);
y = randi([1 9], 1, 10);
figure(1)
plot(x, y, 'ok')
hold on
plot(x(3:2:end), y(3:2:end), '+r') % Overplot With ‘+’
plot(x(2:2:8), y(2:2:8), '.c') % Overplot With ‘.’
hold off
axis([0 10 0 10])
Thanks! I ended up doing something like this and it seemed to work. I just had to play around with the sizes.

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!