PLotting a map/graph

Reply

Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

PLotting a map/graph

 
0
  #1
Aug 6th, 2005
Hi, hmm hav a query right here about how do i go about plotting a map/graph using c programming.

i hav the x and y cordinates which are the variables, but do not know how to go about starting/writing the program.

i heard one of the ways is to import the data using microsoft Excel

Would be grateful if anyone could guide me through this problem..


Thanks,
ben
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

Re: PLotting a map/graph

 
0
  #2
Aug 7th, 2005
anyone knows ?
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster

Re: PLotting a map/graph

 
0
  #3
Aug 7th, 2005
Plotting a graph will almost certainly need to use the services of the operating system to be accomplished. In a console you can plot a simple ascii histogram but not much more. What OS are you using?
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

Re: PLotting a map/graph

 
0
  #4
Aug 7th, 2005
i'm using Miicrosoft Xp Windows.

About what u said earlier about the simple ascii histogram .. Could u maybe explain what is it about.. Nv heard of it b4..
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster

Re: PLotting a map/graph

 
0
  #5
Aug 7th, 2005
Its trivial to plot asterixes for instance in the console but if you want curves or anything more graphical you will need to use a window. How much do you know about making a window and painting it in C?
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

Re: PLotting a map/graph

 
0
  #6
Aug 7th, 2005
Just started reading up some c programming books not long ago.. Perhaps u could give me an example of how to plot just 1 cordinate or something.. because i'm not quite sure about this array thingy.

would appreciate it
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,678
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 263
Lerner Lerner is offline Offline
Posting Virtuoso

Re: PLotting a map/graph

 
0
  #7
Aug 7th, 2005
The C and C++ languages do not have native graphical capabilities. To do things other than bar graphs oriented either horizonally or vertically with the bar made up of a series of characters, (that is histogram), you need to use a third party library such as Windows API or even more sophisticated OpenGL or DirectX.

Example of horizontal histogram to indicate results of poll indicated 60% for option A and 40% for option B using the asterix char:

A ******
B ****

and vertically

*
*
* *
* *
* *
* *
A B
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 7
Reputation: crazyfans86 is an unknown quantity at this point 
Solved Threads: 0
crazyfans86 crazyfans86 is offline Offline
Newbie Poster

Re: PLotting a map/graph

 
0
  #8
Aug 8th, 2005
Sorry, but my working environment would be using the LINUX operating system, so i guess the library file which i include would be differenet ?

Perhaps u could show me an example of the program ?
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 164
Reputation: Stoned_coder is an unknown quantity at this point 
Solved Threads: 5
Stoned_coder Stoned_coder is offline Offline
Junior Poster

Re: PLotting a map/graph

 
0
  #9
Aug 8th, 2005
perhaps you should have a go yourself. To do a histogram in ASCII all you need is iostream. You will not get much help by showing no effort and demanding code.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 7
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: PLotting a map/graph

 
0
  #10
Aug 8th, 2005
If you are working in the linux environment I reccomend using an API such as Qt (for KDE) and gtk+ (for GNOME).

These APIs will allow you to easily have access to opengl functionality (you can read their docs).

For example, with Qt, you would create a main window and overlay the window with a QCanvas widget. On the QCanvas, you can use a paint method to draw pixels at specific locations.

Definetly check out the appropriate api for your linux desktop environment (I'm assuming you are using either KDE or GNOME) -- it makes using OpenGL alot easier.

Let me know how it goes.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Game Development Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC