Ask Your Question
0

Plotting points with different colours

asked 2013-01-11 03:58:31 -0500

I'm trying to plot a number of points such that each has a colour that depends on a certain parameter. I have two lists, points and heights, and I would like to do something like this:

for i in range(len(points)):
    point2d(points[i], rgbcolor = (0,0, heights[i]))

This creates len(points) different graphics, so it's not what I want. What do I need to change?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
4

answered 2013-01-11 04:30:46 -0500

updated 2013-01-11 04:41:45 -0500

Do you need something like:

sum([point((x,sin(x)),rgbcolor=hue(sin(x)),size=30) for x in srange(0,10,0.1)])
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-01-11 03:58:31 -0500

Seen: 95 times

Last updated: Jan 11 '13
{"cc_re__cc_re__cc_by_sa_3_0_le": ["t-having-a-line-connecting-the-branches/\">Is there a reasonable way to plot arcsec (real) without having a line connecting the branches?</a> </p> <p> <a href=\"/question/10164/2d-stem-plot/\">2D stem plot</a> </p> <p> <a href=\"/question/9914/empirical-data-plot/\">Empirical Data Plot</a> </p> <p> <a href=\"/question/9235/2d-plot-axes-labels/\">2d plot axes labels</a> </p> </div> </div> </div> </div> <!-- template footer.html --> <div id=\"ground\"> <div class=\"content-wrapper\"> <div class=\"copyright\"> <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\"> <img\n                            class=\"license-logo\"\n                            src=\"/m/default/media/images/cc-by-sa.png?v=19\"\n                            title=\"cc-by-sa\"\n                            alt=\"cc-by-sa\"\n                        /> </a>\n                \n                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\">Creative Commons Attribution Share", "wrapper\"> <div class=\"copyright\"> <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\"> <img\n                            class=\"license-logo\"\n                            src=\"/m/default/media/images/cc-by-sa.png?v=19\"\n                            title=\"cc-by-sa\"\n                            alt=\"cc-by-sa\"\n                        /> </a>\n                \n                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a <a href=\"http://creativecommons.org/licenses/by-sa/3.0/legalcode\">Creative Commons Attribution Share Alike 3.0</a> license.\n\n            </div> <div class=\"footer-links\" > <a href=\"/about/\">about</a><span class=\"link-separator\"> |</span> <a href=\"/faq/\">faq</a><span class=\"link-separator\"> |</span> <a href=\"/help/\" title=\"help\">help</a> <span class=\"link-separator\"> |</span> <a href=\"/privacy/\">privacy policy</a><span class=\"link-separator\"> |</span> <a href=\"/terms/\">terms of service</a> </div> <div class=\"powered-link\"> <a href=\"http://askbot.com\" target=\"_b"], "copyright__copyright__copyright": ["ete\n\n1 answer\n\nSort by \u00bb oldest newest most voted\n4\n\nanswered 2013-01-11 04:30:46 -0500\n\nupdated 2013-01-11 04:41:45 -0500\n\nDo you need something like:\n\nsum([point((x,sin(x)),rgbcolor=hue(sin(x)),size=30) for x in srange(0,10,0.1)])\nedit flag offensive delete link more\n\nYour Answer\n\nPlease start posting anonymously - your entry will be published after you log in or create a new account.\n\nAdd Answer\n\nQuestion Tools\n\nStats\n\nAsked: 2013-01-11 03:58:31 -0500\n\nSeen: 95 times\n\nLast updated: Jan 11 '13", "ete\n\n1 answer\n\nSort by \u00bb oldest newest most voted\n4\n\nanswered 2013-01-11 04:30:46 -0500\n\nupdated 2013-01-11 04:41:45 -0500\n\nDo you need something like:\n\nsum([point((x,sin(x)),rgbcolor=hue(sin(x)),size=30) for x in srange(0,10,0.1)])\nedit flag offensive delete link more\n\nYour Answer\n\nPlease start posting anonymously - your entry will be published after you log in or create a new account.\n\nAdd Answer\n\nQuestion Tools\n\nStats\n\nAsked: 2013-01-11 03:58:31 -0500\n\nSeen: 95 times\n\nLast updated: Jan 11 '13"]}