Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'canvas': 0.07; 'pixel': 0.07; 'suppose': 0.07; 'tkinter': 0.07; 'annotations': 0.09; 'blue': 0.09; 'grid': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'suggest': 0.11; 'aug': 0.13; 'confusion': 0.16; 'data)': 0.16; 'distinct': 0.16; 'mapped': 0.16; 'planes': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'specified...': 0.16; 'subject:coding': 0.16; 'tend': 0.17; '(or': 0.18; 'bit': 0.21; 'help.': 0.22; "i'd": 0.22; "i've": 0.23; 'idea': 0.24; 'values': 0.26; 'header:X-Complaints-To:1': 0.28; 'this?': 0.28; 'subject:numbers': 0.29; 'convert': 0.29; 'worked': 0.30; 'anybody': 0.32; 'support,': 0.32; 'running': 0.32; 'could': 0.32; 'url:home': 0.33; 'values.': 0.33; 'to:addr :python-list': 0.33; 'thanks': 0.34; 'needed': 0.35; 'table': 0.35; 'something': 0.35; 'received:org': 0.36; 'charset:us-ascii': 0.36; 'possible': 0.37; 'does': 0.37; 'systems,': 0.37; 'rather': 0.37; 'far': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'red': 0.60; 'range': 0.60; 'map': 0.61; 'kind': 0.61; 'back': 0.62; 'email addr:gmail.com': 0.63; 'more': 0.63; 'finally': 0.66; 'color': 0.69; '8-10': 0.84; 'dark': 0.84; 'shade': 0.84; 'subject:color': 0.84; 'temperature': 0.84; 'visually': 0.84; 'white.': 0.84; 'windowing': 0.84; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: color coding for numbers Date: Tue, 21 Aug 2012 13:48:08 -0400 Organization: > Bestiaria Support Staff < References: <57f81534-03af-475f-91c1-aee554e71ab6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-27-81.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345571283 news.xs4all.nl 6970 [2001:888:2000:d::a6]:44280 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27589 On Tue, 21 Aug 2012 01:38:33 -0700 (PDT), namenobodywants@gmail.com declaimed the following in gmane.comp.python.general: > what is the best way of using color/shading on a tkinter canvas as a visualization for a two-dimensional grid of numbers? so far my best idea is to use the same value for R,G and B (fill = '#xyxyxy'), which gives shades of gray. if possible i'd like to have a larger number of visually distinct values. i've seen visualizations that seem to use some kind of hot-versus-cold color coding. does anybody know how to do this? thanks if you can help. > Last time I worked on something using a "temperature scale" it was system with 8-10 bit planes using a color look-up table running from dark blue through reds, greens, and finally white. Data values would be mapped into the range of colors (32-64 depending on hardware; the other bit planes were needed for annotations and windowing support, rather than the color-coded data) On more modern 24-bit (or higher) systems, where each pixel is directly specified... I suppose one could map the data value to the H-component of HLS or HSV (0.0-1.0, or 0 to 360deg); then convert back to RGB. I'd suggest using a range from 0 to 300deg to avoid confusion as the higher "temps" start to shade back to the lowest. Strangely, while data plots tend to use dark blue for "cold" and red for "hot", the color temperature of light is just the other -- dark red is cold, and blue shading into white is hot. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/