unique plot marker for each plot in matplotlib












26















I have a loop where i create some plots and I need unique marker for each plot. I think about creating function, which returns random symbol, and use it in my program in this way:



for i in xrange(len(y)):
plt.plot(x, y [i], randomMarker())


but I think this way is not good one.
I need this just to distinguish plots on legend, because plots must be not connected with lines, they must be just sets of dots.










share|improve this question























  • Do actually need each marker to be different, or do you just want your points to not be connected by a line?

    – Mr. Squig
    Oct 26 '12 at 18:07













  • I need each marker to be different and want points to not be connected by lines.

    – user983302
    Oct 26 '12 at 18:18
















26















I have a loop where i create some plots and I need unique marker for each plot. I think about creating function, which returns random symbol, and use it in my program in this way:



for i in xrange(len(y)):
plt.plot(x, y [i], randomMarker())


but I think this way is not good one.
I need this just to distinguish plots on legend, because plots must be not connected with lines, they must be just sets of dots.










share|improve this question























  • Do actually need each marker to be different, or do you just want your points to not be connected by a line?

    – Mr. Squig
    Oct 26 '12 at 18:07













  • I need each marker to be different and want points to not be connected by lines.

    – user983302
    Oct 26 '12 at 18:18














26












26








26


2






I have a loop where i create some plots and I need unique marker for each plot. I think about creating function, which returns random symbol, and use it in my program in this way:



for i in xrange(len(y)):
plt.plot(x, y [i], randomMarker())


but I think this way is not good one.
I need this just to distinguish plots on legend, because plots must be not connected with lines, they must be just sets of dots.










share|improve this question














I have a loop where i create some plots and I need unique marker for each plot. I think about creating function, which returns random symbol, and use it in my program in this way:



for i in xrange(len(y)):
plt.plot(x, y [i], randomMarker())


but I think this way is not good one.
I need this just to distinguish plots on legend, because plots must be not connected with lines, they must be just sets of dots.







python matplotlib






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 26 '12 at 17:31









user983302user983302

56721018




56721018













  • Do actually need each marker to be different, or do you just want your points to not be connected by a line?

    – Mr. Squig
    Oct 26 '12 at 18:07













  • I need each marker to be different and want points to not be connected by lines.

    – user983302
    Oct 26 '12 at 18:18



















  • Do actually need each marker to be different, or do you just want your points to not be connected by a line?

    – Mr. Squig
    Oct 26 '12 at 18:07













  • I need each marker to be different and want points to not be connected by lines.

    – user983302
    Oct 26 '12 at 18:18

















Do actually need each marker to be different, or do you just want your points to not be connected by a line?

– Mr. Squig
Oct 26 '12 at 18:07







Do actually need each marker to be different, or do you just want your points to not be connected by a line?

– Mr. Squig
Oct 26 '12 at 18:07















I need each marker to be different and want points to not be connected by lines.

– user983302
Oct 26 '12 at 18:18





I need each marker to be different and want points to not be connected by lines.

– user983302
Oct 26 '12 at 18:18












4 Answers
4






active

oldest

votes


















62














itertools.cycle will iterate over a list or tuple indefinitely. This is preferable to a function which randomly picks markers for you.



Python 2.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = marker.next(), linestyle='')


Python 3.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = next(marker), linestyle='')


You can use that to produce a plot like this (Python 2.x):



import numpy as np
import matplotlib.pyplot as plt
import itertools

x = np.linspace(0,2,10)
y = np.sin(x)

marker = itertools.cycle((',', '+', '.', 'o', '*'))

fig = plt.figure()
ax = fig.add_subplot(111)

for q,p in zip(x,y):
ax.plot(q,p, linestyle = '', marker=marker.next())

plt.show()


Example plot






share|improve this answer





















  • 1





    +1'ed since this shows a nice way how this can work with an arbitrary number of plots. Same method works with colors etc.

    – Benjamin Bannier
    Oct 26 '12 at 18:45






  • 3





    +1 Never knew about the itertools.cycle. Much better than the half-baked lambda/modulo schemes I've used before.

    – Chris Zeh
    Oct 26 '12 at 19:22






  • 24





    Just a note for those using Python 3.x, itertools.cycle.next has been changed to next(itertools.cycle()). See stackoverflow.com/questions/5237611/itertools-cycle-next

    – captain_M
    Sep 17 '14 at 22:27





















3














You can also use marker generation by tuple e.g. as



import matplotlib.pyplot as plt
markers = [(i,j,0) for i in range(2,10) for j in range(1, 3)]
[plt.plot(i, 0, marker = markers[i], ms=10) for i in range(16)]


See Matplotlib markers doc site for details.



In addition, this can be combined with itertools.cycle looping mentioned above






share|improve this answer


























  • I like this answer because it allows you to increase the diversity of the markers by increasing the number in the range. Nevertheless, it is not working in v2.0.2 as the first number is the triple should be integer: (numsides, style, angle). I would correct to: n = 16 and markers = [(2+i, 1+i%2, i/n*90.0) for i in range(1, n)].

    – Kyr
    Sep 17 '17 at 16:03



















1














Just manually create an array that contains marker characters and use that, e.g.:



 markers=[',', '+', '-', '.', 'o', '*']





share|improve this answer
























  • Hm, how do you exactly "use that"? When I try ax.plot(t,s, marker=['s', 'o'], ...), I get TypeError: unhashable type: 'list'

    – sdaau
    May 22 '13 at 11:56






  • 1





    This is similar to the ideas above, i.e. cycling over a predefined predefined list. I was not suggesting it can be supplied as a flag to plot().

    – Bitwise
    May 22 '13 at 15:44











  • Thanks for clarifying, @Bitwise - cheers!

    – sdaau
    May 22 '13 at 20:39



















1














import matplotlib.pyplot as plt
fig = plt.figure()
markers=['^', 's', 'p', 'h', '8']
for i in range(5):
plt.plot(x[i], y[i], c='green', marker=markers[i])
plt.xlabel('X Label')
plt.ylabel('Y Label')
plt.show()





share|improve this answer



















  • 2





    Hi, welcome to Stack Overflow. When answering a question that already has many answers, please be sure to add some additional insight into why the response you're providing is substantive and not simply echoing what's already been vetted by the original poster. This is especially important in "code-only" answers such as the one you've provided.

    – chb
    Feb 23 at 2:21











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13091649%2funique-plot-marker-for-each-plot-in-matplotlib%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























4 Answers
4






active

oldest

votes








4 Answers
4






active

oldest

votes









active

oldest

votes






active

oldest

votes









62














itertools.cycle will iterate over a list or tuple indefinitely. This is preferable to a function which randomly picks markers for you.



Python 2.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = marker.next(), linestyle='')


Python 3.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = next(marker), linestyle='')


You can use that to produce a plot like this (Python 2.x):



import numpy as np
import matplotlib.pyplot as plt
import itertools

x = np.linspace(0,2,10)
y = np.sin(x)

marker = itertools.cycle((',', '+', '.', 'o', '*'))

fig = plt.figure()
ax = fig.add_subplot(111)

for q,p in zip(x,y):
ax.plot(q,p, linestyle = '', marker=marker.next())

plt.show()


Example plot






share|improve this answer





















  • 1





    +1'ed since this shows a nice way how this can work with an arbitrary number of plots. Same method works with colors etc.

    – Benjamin Bannier
    Oct 26 '12 at 18:45






  • 3





    +1 Never knew about the itertools.cycle. Much better than the half-baked lambda/modulo schemes I've used before.

    – Chris Zeh
    Oct 26 '12 at 19:22






  • 24





    Just a note for those using Python 3.x, itertools.cycle.next has been changed to next(itertools.cycle()). See stackoverflow.com/questions/5237611/itertools-cycle-next

    – captain_M
    Sep 17 '14 at 22:27


















62














itertools.cycle will iterate over a list or tuple indefinitely. This is preferable to a function which randomly picks markers for you.



Python 2.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = marker.next(), linestyle='')


Python 3.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = next(marker), linestyle='')


You can use that to produce a plot like this (Python 2.x):



import numpy as np
import matplotlib.pyplot as plt
import itertools

x = np.linspace(0,2,10)
y = np.sin(x)

marker = itertools.cycle((',', '+', '.', 'o', '*'))

fig = plt.figure()
ax = fig.add_subplot(111)

for q,p in zip(x,y):
ax.plot(q,p, linestyle = '', marker=marker.next())

plt.show()


Example plot






share|improve this answer





















  • 1





    +1'ed since this shows a nice way how this can work with an arbitrary number of plots. Same method works with colors etc.

    – Benjamin Bannier
    Oct 26 '12 at 18:45






  • 3





    +1 Never knew about the itertools.cycle. Much better than the half-baked lambda/modulo schemes I've used before.

    – Chris Zeh
    Oct 26 '12 at 19:22






  • 24





    Just a note for those using Python 3.x, itertools.cycle.next has been changed to next(itertools.cycle()). See stackoverflow.com/questions/5237611/itertools-cycle-next

    – captain_M
    Sep 17 '14 at 22:27
















62












62








62







itertools.cycle will iterate over a list or tuple indefinitely. This is preferable to a function which randomly picks markers for you.



Python 2.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = marker.next(), linestyle='')


Python 3.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = next(marker), linestyle='')


You can use that to produce a plot like this (Python 2.x):



import numpy as np
import matplotlib.pyplot as plt
import itertools

x = np.linspace(0,2,10)
y = np.sin(x)

marker = itertools.cycle((',', '+', '.', 'o', '*'))

fig = plt.figure()
ax = fig.add_subplot(111)

for q,p in zip(x,y):
ax.plot(q,p, linestyle = '', marker=marker.next())

plt.show()


Example plot






share|improve this answer















itertools.cycle will iterate over a list or tuple indefinitely. This is preferable to a function which randomly picks markers for you.



Python 2.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = marker.next(), linestyle='')


Python 3.x



import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
for n in y:
plt.plot(x,n, marker = next(marker), linestyle='')


You can use that to produce a plot like this (Python 2.x):



import numpy as np
import matplotlib.pyplot as plt
import itertools

x = np.linspace(0,2,10)
y = np.sin(x)

marker = itertools.cycle((',', '+', '.', 'o', '*'))

fig = plt.figure()
ax = fig.add_subplot(111)

for q,p in zip(x,y):
ax.plot(q,p, linestyle = '', marker=marker.next())

plt.show()


Example plot







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 3 at 3:26









rsc

7,56532128




7,56532128










answered Oct 26 '12 at 18:31









Mr. SquigMr. Squig

2,2271110




2,2271110








  • 1





    +1'ed since this shows a nice way how this can work with an arbitrary number of plots. Same method works with colors etc.

    – Benjamin Bannier
    Oct 26 '12 at 18:45






  • 3





    +1 Never knew about the itertools.cycle. Much better than the half-baked lambda/modulo schemes I've used before.

    – Chris Zeh
    Oct 26 '12 at 19:22






  • 24





    Just a note for those using Python 3.x, itertools.cycle.next has been changed to next(itertools.cycle()). See stackoverflow.com/questions/5237611/itertools-cycle-next

    – captain_M
    Sep 17 '14 at 22:27
















  • 1





    +1'ed since this shows a nice way how this can work with an arbitrary number of plots. Same method works with colors etc.

    – Benjamin Bannier
    Oct 26 '12 at 18:45






  • 3





    +1 Never knew about the itertools.cycle. Much better than the half-baked lambda/modulo schemes I've used before.

    – Chris Zeh
    Oct 26 '12 at 19:22






  • 24





    Just a note for those using Python 3.x, itertools.cycle.next has been changed to next(itertools.cycle()). See stackoverflow.com/questions/5237611/itertools-cycle-next

    – captain_M
    Sep 17 '14 at 22:27










1




1





+1'ed since this shows a nice way how this can work with an arbitrary number of plots. Same method works with colors etc.

– Benjamin Bannier
Oct 26 '12 at 18:45





+1'ed since this shows a nice way how this can work with an arbitrary number of plots. Same method works with colors etc.

– Benjamin Bannier
Oct 26 '12 at 18:45




3




3





+1 Never knew about the itertools.cycle. Much better than the half-baked lambda/modulo schemes I've used before.

– Chris Zeh
Oct 26 '12 at 19:22





+1 Never knew about the itertools.cycle. Much better than the half-baked lambda/modulo schemes I've used before.

– Chris Zeh
Oct 26 '12 at 19:22




24




24





Just a note for those using Python 3.x, itertools.cycle.next has been changed to next(itertools.cycle()). See stackoverflow.com/questions/5237611/itertools-cycle-next

– captain_M
Sep 17 '14 at 22:27







Just a note for those using Python 3.x, itertools.cycle.next has been changed to next(itertools.cycle()). See stackoverflow.com/questions/5237611/itertools-cycle-next

– captain_M
Sep 17 '14 at 22:27















3














You can also use marker generation by tuple e.g. as



import matplotlib.pyplot as plt
markers = [(i,j,0) for i in range(2,10) for j in range(1, 3)]
[plt.plot(i, 0, marker = markers[i], ms=10) for i in range(16)]


See Matplotlib markers doc site for details.



In addition, this can be combined with itertools.cycle looping mentioned above






share|improve this answer


























  • I like this answer because it allows you to increase the diversity of the markers by increasing the number in the range. Nevertheless, it is not working in v2.0.2 as the first number is the triple should be integer: (numsides, style, angle). I would correct to: n = 16 and markers = [(2+i, 1+i%2, i/n*90.0) for i in range(1, n)].

    – Kyr
    Sep 17 '17 at 16:03
















3














You can also use marker generation by tuple e.g. as



import matplotlib.pyplot as plt
markers = [(i,j,0) for i in range(2,10) for j in range(1, 3)]
[plt.plot(i, 0, marker = markers[i], ms=10) for i in range(16)]


See Matplotlib markers doc site for details.



In addition, this can be combined with itertools.cycle looping mentioned above






share|improve this answer


























  • I like this answer because it allows you to increase the diversity of the markers by increasing the number in the range. Nevertheless, it is not working in v2.0.2 as the first number is the triple should be integer: (numsides, style, angle). I would correct to: n = 16 and markers = [(2+i, 1+i%2, i/n*90.0) for i in range(1, n)].

    – Kyr
    Sep 17 '17 at 16:03














3












3








3







You can also use marker generation by tuple e.g. as



import matplotlib.pyplot as plt
markers = [(i,j,0) for i in range(2,10) for j in range(1, 3)]
[plt.plot(i, 0, marker = markers[i], ms=10) for i in range(16)]


See Matplotlib markers doc site for details.



In addition, this can be combined with itertools.cycle looping mentioned above






share|improve this answer















You can also use marker generation by tuple e.g. as



import matplotlib.pyplot as plt
markers = [(i,j,0) for i in range(2,10) for j in range(1, 3)]
[plt.plot(i, 0, marker = markers[i], ms=10) for i in range(16)]


See Matplotlib markers doc site for details.



In addition, this can be combined with itertools.cycle looping mentioned above







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 12 '18 at 8:38









DomQ

2,4262225




2,4262225










answered Dec 8 '16 at 8:44









Pavel ProchazkaPavel Prochazka

31736




31736













  • I like this answer because it allows you to increase the diversity of the markers by increasing the number in the range. Nevertheless, it is not working in v2.0.2 as the first number is the triple should be integer: (numsides, style, angle). I would correct to: n = 16 and markers = [(2+i, 1+i%2, i/n*90.0) for i in range(1, n)].

    – Kyr
    Sep 17 '17 at 16:03



















  • I like this answer because it allows you to increase the diversity of the markers by increasing the number in the range. Nevertheless, it is not working in v2.0.2 as the first number is the triple should be integer: (numsides, style, angle). I would correct to: n = 16 and markers = [(2+i, 1+i%2, i/n*90.0) for i in range(1, n)].

    – Kyr
    Sep 17 '17 at 16:03

















I like this answer because it allows you to increase the diversity of the markers by increasing the number in the range. Nevertheless, it is not working in v2.0.2 as the first number is the triple should be integer: (numsides, style, angle). I would correct to: n = 16 and markers = [(2+i, 1+i%2, i/n*90.0) for i in range(1, n)].

– Kyr
Sep 17 '17 at 16:03





I like this answer because it allows you to increase the diversity of the markers by increasing the number in the range. Nevertheless, it is not working in v2.0.2 as the first number is the triple should be integer: (numsides, style, angle). I would correct to: n = 16 and markers = [(2+i, 1+i%2, i/n*90.0) for i in range(1, n)].

– Kyr
Sep 17 '17 at 16:03











1














Just manually create an array that contains marker characters and use that, e.g.:



 markers=[',', '+', '-', '.', 'o', '*']





share|improve this answer
























  • Hm, how do you exactly "use that"? When I try ax.plot(t,s, marker=['s', 'o'], ...), I get TypeError: unhashable type: 'list'

    – sdaau
    May 22 '13 at 11:56






  • 1





    This is similar to the ideas above, i.e. cycling over a predefined predefined list. I was not suggesting it can be supplied as a flag to plot().

    – Bitwise
    May 22 '13 at 15:44











  • Thanks for clarifying, @Bitwise - cheers!

    – sdaau
    May 22 '13 at 20:39
















1














Just manually create an array that contains marker characters and use that, e.g.:



 markers=[',', '+', '-', '.', 'o', '*']





share|improve this answer
























  • Hm, how do you exactly "use that"? When I try ax.plot(t,s, marker=['s', 'o'], ...), I get TypeError: unhashable type: 'list'

    – sdaau
    May 22 '13 at 11:56






  • 1





    This is similar to the ideas above, i.e. cycling over a predefined predefined list. I was not suggesting it can be supplied as a flag to plot().

    – Bitwise
    May 22 '13 at 15:44











  • Thanks for clarifying, @Bitwise - cheers!

    – sdaau
    May 22 '13 at 20:39














1












1








1







Just manually create an array that contains marker characters and use that, e.g.:



 markers=[',', '+', '-', '.', 'o', '*']





share|improve this answer













Just manually create an array that contains marker characters and use that, e.g.:



 markers=[',', '+', '-', '.', 'o', '*']






share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 26 '12 at 17:39









BitwiseBitwise

5,30422243




5,30422243













  • Hm, how do you exactly "use that"? When I try ax.plot(t,s, marker=['s', 'o'], ...), I get TypeError: unhashable type: 'list'

    – sdaau
    May 22 '13 at 11:56






  • 1





    This is similar to the ideas above, i.e. cycling over a predefined predefined list. I was not suggesting it can be supplied as a flag to plot().

    – Bitwise
    May 22 '13 at 15:44











  • Thanks for clarifying, @Bitwise - cheers!

    – sdaau
    May 22 '13 at 20:39



















  • Hm, how do you exactly "use that"? When I try ax.plot(t,s, marker=['s', 'o'], ...), I get TypeError: unhashable type: 'list'

    – sdaau
    May 22 '13 at 11:56






  • 1





    This is similar to the ideas above, i.e. cycling over a predefined predefined list. I was not suggesting it can be supplied as a flag to plot().

    – Bitwise
    May 22 '13 at 15:44











  • Thanks for clarifying, @Bitwise - cheers!

    – sdaau
    May 22 '13 at 20:39

















Hm, how do you exactly "use that"? When I try ax.plot(t,s, marker=['s', 'o'], ...), I get TypeError: unhashable type: 'list'

– sdaau
May 22 '13 at 11:56





Hm, how do you exactly "use that"? When I try ax.plot(t,s, marker=['s', 'o'], ...), I get TypeError: unhashable type: 'list'

– sdaau
May 22 '13 at 11:56




1




1





This is similar to the ideas above, i.e. cycling over a predefined predefined list. I was not suggesting it can be supplied as a flag to plot().

– Bitwise
May 22 '13 at 15:44





This is similar to the ideas above, i.e. cycling over a predefined predefined list. I was not suggesting it can be supplied as a flag to plot().

– Bitwise
May 22 '13 at 15:44













Thanks for clarifying, @Bitwise - cheers!

– sdaau
May 22 '13 at 20:39





Thanks for clarifying, @Bitwise - cheers!

– sdaau
May 22 '13 at 20:39











1














import matplotlib.pyplot as plt
fig = plt.figure()
markers=['^', 's', 'p', 'h', '8']
for i in range(5):
plt.plot(x[i], y[i], c='green', marker=markers[i])
plt.xlabel('X Label')
plt.ylabel('Y Label')
plt.show()





share|improve this answer



















  • 2





    Hi, welcome to Stack Overflow. When answering a question that already has many answers, please be sure to add some additional insight into why the response you're providing is substantive and not simply echoing what's already been vetted by the original poster. This is especially important in "code-only" answers such as the one you've provided.

    – chb
    Feb 23 at 2:21
















1














import matplotlib.pyplot as plt
fig = plt.figure()
markers=['^', 's', 'p', 'h', '8']
for i in range(5):
plt.plot(x[i], y[i], c='green', marker=markers[i])
plt.xlabel('X Label')
plt.ylabel('Y Label')
plt.show()





share|improve this answer



















  • 2





    Hi, welcome to Stack Overflow. When answering a question that already has many answers, please be sure to add some additional insight into why the response you're providing is substantive and not simply echoing what's already been vetted by the original poster. This is especially important in "code-only" answers such as the one you've provided.

    – chb
    Feb 23 at 2:21














1












1








1







import matplotlib.pyplot as plt
fig = plt.figure()
markers=['^', 's', 'p', 'h', '8']
for i in range(5):
plt.plot(x[i], y[i], c='green', marker=markers[i])
plt.xlabel('X Label')
plt.ylabel('Y Label')
plt.show()





share|improve this answer













import matplotlib.pyplot as plt
fig = plt.figure()
markers=['^', 's', 'p', 'h', '8']
for i in range(5):
plt.plot(x[i], y[i], c='green', marker=markers[i])
plt.xlabel('X Label')
plt.ylabel('Y Label')
plt.show()






share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 23 at 1:30









Keerthana ManjunathaKeerthana Manjunatha

214




214








  • 2





    Hi, welcome to Stack Overflow. When answering a question that already has many answers, please be sure to add some additional insight into why the response you're providing is substantive and not simply echoing what's already been vetted by the original poster. This is especially important in "code-only" answers such as the one you've provided.

    – chb
    Feb 23 at 2:21














  • 2





    Hi, welcome to Stack Overflow. When answering a question that already has many answers, please be sure to add some additional insight into why the response you're providing is substantive and not simply echoing what's already been vetted by the original poster. This is especially important in "code-only" answers such as the one you've provided.

    – chb
    Feb 23 at 2:21








2




2





Hi, welcome to Stack Overflow. When answering a question that already has many answers, please be sure to add some additional insight into why the response you're providing is substantive and not simply echoing what's already been vetted by the original poster. This is especially important in "code-only" answers such as the one you've provided.

– chb
Feb 23 at 2:21





Hi, welcome to Stack Overflow. When answering a question that already has many answers, please be sure to add some additional insight into why the response you're providing is substantive and not simply echoing what's already been vetted by the original poster. This is especially important in "code-only" answers such as the one you've provided.

– chb
Feb 23 at 2:21


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13091649%2funique-plot-marker-for-each-plot-in-matplotlib%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mossoró

Error while reading .h5 file using the rhdf5 package in R

Pushsharp Apns notification error: 'InvalidToken'