2D- Grafiken plotten
-
Hallo,
ich bin ein Neuling in C++ und stoße mittlerweile jetzt schon nach kurzer Einarbeitungszeit an meine Grenzen. Deswegen hoffe ich auf eure Hilfe.
Mein Problem ist folgendes. Ich habe mit einem C++ Programm ein Data Output generiert das mir eine Datei mit folgender Formatierung erzeugt
345 23.4567
234 45.456
134 34.567
94 56.678Leider habe ich Probleme dieses ausgegebe Array in irgendeiner Form als Grafik darzustellen.
Ich hatte mich schon über Möglichkeiten informiert. So gibt es das kostenpflichtige Library von http://www.softintegration.com. Da man hier Geld ausgeben muss, wollte ich diese ungerne benutzen.
zudem gab es noch weitere Möglichkeiten, die ich finden konnte. Einerseits http://codecutter.org/tools/koolplot/. hierzu habe ich aber nichts gefunden, wie , und ob es sich in Visual C++ Express einbinden lässt.
Vielleicht hatte einer von euch schon erfahrungen damit machen können, und es ebenfalls schon in C++ eingebunden.Und zu guter letzt GNUPLOT. Hierzu habe ich ein Interface gefunden, dass GNUPLOT in C++ einbinden kann. http://www.programmersheaven.com/download/42173/download.aspx Doch hatte ich hier leider das Problem, dass mir der Compiler von Visual C++ Express Fehler ausspuckt, wenn ich dazu das Beispielprogramm starten will.
Folgendes spuckt mir der Compiler raus.
Gnuplot.cpp
1>c:\documents and settings\dro\desktop\c++\gnuplot\gnuplot\gnuplot.cpp(64) : error C2039: '_popen' : is not a member of 'std'
1>c:\documents and settings\dro\desktop\c++\gnuplot\gnuplot\gnuplot.cpp(102) : warning C4267: 'initializing' : conversion from 'size_t' to 'const int', possible loss of data
1>c:\documents and settings\dro\desktop\c++\gnuplot\gnuplot\gnuplot.cpp(113) : warning C4267: 'initializing' : conversion from 'size_t' to 'const int', possible loss of data
1>c:\documents and settings\dro\desktop\c++\gnuplot\gnuplot\gnuplot.cpp(178) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
1>c:\documents and settings\dro\desktop\c++\gnuplot\gnuplot\gnuplot.cpp(233) : warning C4267: 'initializing' : conversion from 'size_t' to 'const int', possible loss of data
1>c:\documents and settings\dro\desktop\c++\gnuplot\gnuplot\gnuplot.cpp(280) : warning C4267: 'initializing' : conversion from 'size_t' to 'const int', possible loss of data
1>c:\documents and settings\dro\desktop\c++\gnuplot\gnuplot\gnuplot.cpp(291) : warning C4267: 'initializing' : conversion from 'size_t' to 'const int', possible loss of data
1>c:\documents and settings\dro\desktop\c++\gnuplot\gnuplot\gnuplot.cpp(303) : warning C4267: 'initializing' : conversion from 'size_t' to 'const int', possible loss of data
1>Build log was saved at "file://c:\Documents and Settings\dro\Desktop\c++\Gnuplot\gnuplot\Debug\BuildLog.htm"
1>gnuplot - 1 error(s), 7 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========Zudem wird keine Datei .txt erzeugt in die ich den Pfad von Gnuplot reinschreiben kann.
Es wäre toll, wenn jemand mir helfen könnte und zudem auch vielleicht Schritt für Schritt beschreibt , was zu tun ist, da ich bei C++ nur ein Anfänger bin.
Ich arbeite wie schon gesagt im Visual C++ Express und zwar momentan in der Win32 Console Application.
Vielen Dank!und grüße
payon
-
Gnuplot C++ interface v2.0 Very easy C++ interface to plot values in Gnuplot. Uses only the standard header files. Combined with Gnuplot being cross-platform, I guessed this interface was too. It worked under Macintosh, [b]but NOT under Windows[/b] (see files for more info). It can do line-plots, scatter plots and should do surface plots as well. The surface plot however, does not function on all terminals (including my own). This simple class can easily be extended in functionality and if you do, let me know! Have fun with it! I've also included a main() demonstrating the class's functionality.
???
-
außerdem kannst die warings alle ignorieren size_t ist imho unsigned int. Wenn du also nicht (2^32)/2 überschreitest ist es egal trotzdem ist es besser unsigned voran zu hauen, dann hast als neues limit 2^32
mfg tobZel
-
Hmm, danke für eure Hilfe. Doch so richtig geholfen ist mir noch nicht.
Ich hatte nur feststellen können, dass Gnuplot nicht unter Windows funktioniert. Doch welche Alternativen hab ich bzw. welche Alternativen benutzt ihr?
Ist es wirklich so schwierig Graphen darzustellen in C++ unter Windwows?
gruss
payon
-
Hallo,
tut mir leid fürs doppelposting, aber ist da wirklich niemand, der mir helfen kann?
gruss
payon
-
Schau mal nach Borland-Dateien...
<graphics.h>
Kenn GnuPlott nicht, aber du Borland nicht
"bcc32" ist v5.5 von borland und FREI!