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

  • Home
  • SEARCH
  • 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 8840115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:23:30+00:00 2026-06-14T10:23:30+00:00

I am stuck on a question. If i have a set of data in

  • 0

I am stuck on a question. If i have a set of data in a list (say number of students and their corresponding grade) How would I code that to create a histogram in quickdraw?

  • 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-06-14T10:23:32+00:00Added an answer on June 14, 2026 at 10:23 am

    Quickdraw doesn’t support graphs out of the box. Everything needs to be drawn and mapped yourself, Here is an example:

    #!/bin/python 
    
    import random
    
    #create 40 random grades 
    grades = [(float(int(float(20*random.random())))/2)+0.5 for i in xrange(40)]
    
    #count the occurrence of each grade
    histogram = []
    for i in sorted(set(grades)): histogram.append([int(i*50),grades.count(i)])
    
    #some grid information
    gridsize = 500
    griddiv = 20
    topleft = 50
    
    #graph title
    print 'text', '"','Histogram of Grades','"', 220, 25
    
    #x axis title
    for i in range(1,21):
        print 'text', '"',float(i)/2,'"', (i+1)*25, 570
    
    #y axix title
    for i in range(0,11):
        print 'text', '"',i,'"', 25, 600-(i+1)*50
    
    #grid
    print 'grid', topleft, topleft, gridsize, gridsize, griddiv, griddiv
    
    #chart rectangles 
    print 'color 0 140 0'
    for i in histogram:
        print 'fillrect',i[0]-25+topleft, gridsize-(50*i[1])+topleft,gridsize/griddiv,50*i[1],'b'+str(i[0])
        print 'fillrect', 'color','b'+str(i[0])
    

    Save the code in histogram.py and run python histogram.py | java -jar quickdraw.jar be warned it’s not very pretty! A better method would be to use the python library matplotlib

    enter image description here

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

Sidebar

Related Questions

I have a set of actions that are returning time-series data with-in ranges specifiable
Simple question I hope. If I have a set of data like this: Classification
i have a question, been stuck for a while, i dont know how can
I have to ask this question because I'm stuck, and I think its because
A little stuck here. I have a simple question I guess. Given the following
I realize this question is pretty basic, but I'm really stuck. I have a
I have a question considering a program that stimulates a stack (not using any
I have a large data set (200GB uncompressed, 9GB compressed in bz2 -9 )
I have a question in core data: there are 2 Entities in the project,
I think my question is best described as an example. Let's say I have

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.