Skip to main content
gamedev.net
🔒 Locked

Making Line Graphs

Started by Shaun Patterson Apr 1, 2000 at 2:56 PM 1 replies 1.6k views
Original Post
Shaun Patterson
Shaun Patterson
Hi, this isn''t really a game programming question. However, it does have something to do with graphics. Anywho, I''m having trouble with a program I''m currently developing. My problem is I have a table of values basically and I''m trying to construct a line graph. Something like this: (These are the ones on the Y axis I want to plot) 102 130 236 32 76 260 ...ect I''m having trouble with determining the scale factor, or Y axis increment.. or whatever you''d like to call it. Basically how much each pixel represents on the Y axis. Get it? / / / <-- increment for this axis... / /-------- 0 1 2 3 4 I can''t seem to figure this part out. Any help is appreciated. Thanks, Shaun Patterson
Zipster
Zipster
well, the problem is that you want to work with 2 coordinate systems: one with the origin in the upper left, and one with the origin in the lower left, along with the fact that 102, 130, etc., might not be the number of pixels,but another unit of measurement, but ill leave that up to others
as for the origin flip, just do (SCREEN_HEIGHT-y) to plot a y with lower left being the origin

Edited by - Zipster on 4/1/00 5:32:14 PM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.