Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 296319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:32:17+00:00 2026-05-12T06:32:17+00:00

For a home project I need to plot (x,y) coordinates onto a 400×400 black

  • 0

For a home project I need to plot (x,y) coordinates onto a 400×400 black and white-bitmap.

What perl module would you recoment and what image format (GIF?, PNG? other?) would be easiest to handle on OS X, Windows, Linux?


EDIT My solution, based on GD, as recomended by Brian Agnew


use strict;
use warnings;
use GD;
my $BitMap = GD::Image->new(400,400);

my $white = $BitMap->colorAllocate(255,255,255);
my $black = $BitMap->colorAllocate(0,0,0);       

# Frame the BitMap
$BitMap->rectangle(0,0,399,399,$black);
# Transparent image, white background color
$BitMap->transparent($white);

# plot some, just to show it works #
for my $x (0..100) {
   for my $y (0 .. 100) {
      $BitMap->setPixel(250+100*sin($x)-$y,150+125*cos($x)+$y,$black); 
   }
}

# write png-format to file
open my $fh,">","test.png" or die "$!";
binmode $fh;
print $fh $BitMap->png;
close($fh);

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:32:17+00:00Added an answer on May 12, 2026 at 6:32 am

    Have a look at the GD module (which interfaces to the GD library). It makes creating graphics pretty trivial and has a wide range of output formats, including PNG and GIF.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to have an at-home project now that I'm working on Python/Django at
I'm learning C# and now I need to build a home project(just to learn
I learning Perl and doing a home made project to my family (a subscription
I am making one project where i need to display Home page and when
I need to get a username from an Unix path with this format: /home/users/myusername/project/number/files
So I started a little home project in MVC 3 where I need to
I'm now developing a home project, but before I start, I need to know
I need my MVC 3.0 project to support modules. By module I mean having
I have a python project with this directory structure and these files: /home/project_root |---__init__.py
Snippet from deploy.rb task :prod1 do set :deploy_to, /home/project/src/prod1 end task :prod2 do set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.