943,704 Members | Top Members by Rank

Ad:
Aug 6th, 2005
0

PLotting a map/graph

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
crazyfans86 is offline Offline
7 posts
since Jul 2005
Aug 7th, 2005
0

Re: PLotting a map/graph

anyone knows ?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
crazyfans86 is offline Offline
7 posts
since Jul 2005
Aug 7th, 2005
0

Re: PLotting a map/graph

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?
Reputation Points: 19
Solved Threads: 5
Junior Poster
Stoned_coder is offline Offline
164 posts
since Jul 2005
Aug 7th, 2005
0

Re: PLotting a map/graph

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..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
crazyfans86 is offline Offline
7 posts
since Jul 2005
Aug 7th, 2005
0

Re: PLotting a map/graph

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?
Reputation Points: 19
Solved Threads: 5
Junior Poster
Stoned_coder is offline Offline
164 posts
since Jul 2005
Aug 7th, 2005
0

Re: PLotting a map/graph

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
crazyfans86 is offline Offline
7 posts
since Jul 2005
Aug 7th, 2005
0

Re: PLotting a map/graph

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
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Lerner is offline Offline
2,253 posts
since Jul 2005
Aug 8th, 2005
0

Re: PLotting a map/graph

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 ?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
crazyfans86 is offline Offline
7 posts
since Jul 2005
Aug 8th, 2005
0

Re: PLotting a map/graph

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.
Reputation Points: 19
Solved Threads: 5
Junior Poster
Stoned_coder is offline Offline
164 posts
since Jul 2005
Aug 8th, 2005
0

Re: PLotting a map/graph

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.
Reputation Points: 28
Solved Threads: 9
Posting Whiz in Training
BountyX is offline Offline
222 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Game Development Forum Timeline: Linux Sound??
Next Thread in Game Development Forum Timeline: Rookie in game development. Where should I start?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC