Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hi, Thanks for the reply, I am using below code, it is giving me following error. Can't locate object method "Imager=HASH(0xfeeb4d0)" via package "Imager::Heatmap" at heatmap.pl line 28.
#!/usr/bin/perl -w use strict; #use warnings; use utf8; use XSLoader; use Carp; use Imager; use List::Util qw/ max /; use Imager; use Imager::Heatmap; my $hmap = Imager::Heatmap->new( xsize => 640, # Image width ysize => 480, # Image height xsigma => 10, # Sigma value of X-direction ysigma => 10, # Sigma value of Y-direction ); my @piont_datas = ( [ 10, 20, 50 ], [ 20, 40, 70 ] ); # Add point datas to construct density matrix $hmap->insert_datas(@piont_datas); # @point_datas should be: ( [ x1, y +1, weight1 ], [ x2, y2, weight2 ] ... ) #$hmap->insert_datas(...); # You can call multiple times to add large +data that cannot process at a time. # After adding datas, you could get heatmap as Imager instance. my $img = $hmap->draw; # Returned image is 4-channels image. So you can overlay it on other i +mages. my $base_img->rubthrough( src => $hmap->$img ); # Overlay on other im +ages(see Imager::Transformations) $img = Imager->new( xsize => $hmap->xsize, ysize => $hmap->ysize, channels => 4, ); # And you can access probability density matrix using matrix method if + you like. # In case, maybe you would like to create some graduations which be as +signed to color of heatmap and its value. $hmap->matrix;

In reply to Re^2: Creating Heat Map in perl by huzefa52
in thread Creating Heat Map in perl by huzefa52

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (11)
    As of 2014-10-20 10:38 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (75 votes), past polls