Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > drawing graph

Reply
Thread Tools

drawing graph

 
 
adonis
Guest
Posts: n/a
 
      04-18-2008
hi to everybody.
how can i draw a 2d diagram in vc++?
i don't know anything about thath.
please help me.
thanks.
 
Reply With Quote
 
 
 
 
utab
Guest
Posts: n/a
 
      04-18-2008
On Apr 18, 9:05 am, adonis <(E-Mail Removed)> wrote:
> hi to everybody.
> how can i draw a 2d diagram in vc++?
> i don't know anything about thath.
> please help me.
> thanks.


This is not possible through standard C++, however it is possible by
using API functions in windows or equivalents in linux. The easiest
way would be to call an open source plotter, such as gnuplot. You can
call gnuplot from within C++ with "system" function however forming
the data file and making the plot outside the program seems better to
me.
 
Reply With Quote
 
 
 
 
adonis
Guest
Posts: n/a
 
      04-18-2008
On Apr 18, 3:52*pm, utab <(E-Mail Removed)> wrote:
> On Apr 18, 9:05 am, adonis <(E-Mail Removed)> wrote:
>
> > hi to everybody.
> > how can i draw a 2d diagram in vc++?
> > i don't know anything about thath.
> > please help me.
> > thanks.

>
> This is not possible through standard C++, however it is possible by
> using API functions in windows or equivalents in linux. The easiest
> way would be to call an open source plotter, such as gnuplot. You can
> call gnuplot from within C++ with "system" function however forming
> the data file and making the plot outside the program seems better to
> me.


can i do that in MATLAB?
is it possible to import data in MATLAB?
how can i do that?
 
Reply With Quote
 
red floyd
Guest
Posts: n/a
 
      04-18-2008
adonis wrote:
> On Apr 18, 3:52 pm, utab <(E-Mail Removed)> wrote:
>> On Apr 18, 9:05 am, adonis <(E-Mail Removed)> wrote:
>>
>>> hi to everybody.
>>> how can i draw a 2d diagram in vc++?
>>> i don't know anything about thath.
>>> please help me.
>>> thanks.

>> This is not possible through standard C++, however it is possible by
>> using API functions in windows or equivalents in linux. The easiest
>> way would be to call an open source plotter, such as gnuplot. You can
>> call gnuplot from within C++ with "system" function however forming
>> the data file and making the plot outside the program seems better to
>> me.

>
> can i do that in MATLAB?
> is it possible to import data in MATLAB?
> how can i do that?


Yes, yes, and ask in a forum where MATLAB is topical (try
comp.soft-sys.matlab).
 
Reply With Quote
 
utab
Guest
Posts: n/a
 
      04-18-2008
On Apr 18, 8:52 pm, adonis <(E-Mail Removed)> wrote:
> On Apr 18, 3:52 pm, utab <(E-Mail Removed)> wrote:
>
> > On Apr 18, 9:05 am, adonis <(E-Mail Removed)> wrote:

>
> > > hi to everybody.
> > > how can i draw a 2d diagram in vc++?
> > > i don't know anything about thath.
> > > please help me.
> > > thanks.

>
> > This is not possible through standard C++, however it is possible by
> > using API functions in windows or equivalents in linux. The easiest
> > way would be to call an open source plotter, such as gnuplot. You can
> > call gnuplot from within C++ with "system" function however forming
> > the data file and making the plot outside the program seems better to
> > me.

>
> can i do that in MATLAB?
> is it possible to import data in MATLAB?
> how can i do that?


MATLAB and C++ are two different environments/languages, MATLAB is an
interpretted language for fast manipulation of array computations and
to do first tries for a numerical work. What is your specific task?

MATLAB has many built-in functions which you may use for many of your
tasks including plotting graphs, but what is your aim? Still it is not
that clear to me.

Rgds,
 
Reply With Quote
 
SeanW
Guest
Posts: n/a
 
      04-18-2008
On Apr 18, 3:05 am, adonis <(E-Mail Removed)> wrote:
> hi to everybody.
> how can i draw a 2d diagram in vc++?
> i don't know anything about thath.
> please help me.
> thanks.


As others have said, you'll need some external library.
The ImageMagick++ library fits nicely with C++
and its standard library:

http://www.imagemagick.org/Magick++/

The following brief program takes coordinates from
the standard input and draws corresponding points
on a GIF image.

Sean



#include <iostream>
#include <Magick++.h>

using namespace std;
using namespace Magick;

int main()
{
int width = 300;
int height = 400;
Image image( Geometry(width, height), Color("white") );

image.strokeColor("red");

// take space-separated (x,y) coordinates
while (cin)
{
int x, y;
cin >> x >> y;
image.draw(DrawablePoint(x, height - y));
}

image.write("dots.gif");
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Guide to the standard library? Library for drawing in GUIs?drawing inbrowsers? defn noob Java 1 06-28-2008 02:50 AM
funny drawing software:ScreenPen,drawing directly on screen! yyzzbb@sina.com Digital Photography 0 02-04-2006 12:31 AM
System.Drawing For Drawing Text Images jjbutera@hotmail.com ASP .Net 1 01-09-2006 09:55 PM
drawing a graph Newbie Java 8 05-18-2005 11:50 AM
GD::Graph: "mixed" graph doesn't recognize "area" graph type Emilio Mayorga Perl Misc 6 10-08-2003 02:14 AM



Advertisments