Update1: I realize that PDL may be quite well suited for much of the above workflow, but I have had major issues with PDL's image plotting modules. Maybe I can do first part of the work with PDL, but am not very confident about generating images with it.
Update2: Added potential module names to tasks.
I want to visualize numbers in a table as a color ramp (or other color schemes). Below is how I would go about it. I am looking for suggestions for improving the process, and for modules that I can use.
Note: All numbers map to locations, hence, are values (for that particular variable) that can be placed on a rectangular image. In other words, the "rainfall" table has rainfall numbers that I want to convert to an image, one number per pixel.
- $res = SELECT rainfall FROM rainfall_table WHERE <condition>. use DBI;
- convert $res into an "interval" data set that can be mapped to a color table, otherwise their will be way too many colors, pointless in a web application anyway use Statistics::Descriptive; ??
- choose a color scheme, preferably one that can follow good color principles, such as espoused by Cindy Brewer's http://colorbrewer.org. Or, at the least, be able to say -- "make me an image using a color ramp from 'dark blue (some rgb combo)' to 'bright pink (some rgb combo)'" use Imager::Color::Table; ??
- generate the image use Imager or Image::Imlib2 or ImageMagick or GD; ??
Of course, the db work need DBI/DBD. But, what would I use to generate statistics on $res above? For example, converting the retrieved rows into interval groupings of different classes? Any suggestions for color table matching? And, what are the suggested modules for generating the image -- CPAN is full of image modules. I have ImageMagick already installed, but there is GD, the old stalwart, Imager, and a whole bunch more. Any toolbox with such tools already built in?
--
when small people start casting long shadows, it is time to go to bed
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.