Is There Any 'Out-Of-The-Box' 2D/3D Plotting Library for C++

Plotting framework

Lots of suggestions here Is there any 'out-of-the-box' 2D/3D plotting library for C++?

Good, free, easy-to-use C graphics libraries?

To plot 2D and 3D graphs in C I would recommend the library DISLIN. You can see examples here or there.

The code is pretty easy to use and gives nice results.

Path line plotting graphics library/engine for C/C++?

If you break down what the library would need to do,
you end up with some pretty basic functions,

which you probably won't find encapsulated as a library
since they are pretty trivial.

Step 1: "Segments to 3d Points"

a) Create a unit vector along your reference axis.

b) Scale it by the segment distance.

c) Rotate it by the bearing.

d) Rotate it by the declination.

(Note: Assuming bearing and declination are orthogonal you shouldn't run into any trouble.)

e) Add the start of the segment (aka the last vector).

Step 2: "3d Points to 2d Points"

a) Multiply your 3d vector through a perspective or orthognal projection matrix.

Step 3: "2d points to lines"

a) Use the bresenham line algorithm to gte the individual pixels.

Once you finished Step 2 and actually have lines in 2-point representation
all drawing libraries should do.

No magic at all ;)

(Note: There are lots of flight tracking/mapping apps out there that do a mighty fine job.)

I want to draw a graph in my winapi C program, is there any control?

You definitely should search for any kind of such library at CodeProject in the "Desktop Development -> Miscellaneous" section. But as to me, I'd use "A 2D data visualisation class" which provides a very nice set of features (from the article):

  • Normal and scatter graph modes
  • Autoscale
  • Zooming
  • Fit width, height and page
  • Mouse coordinates tracing
  • Ability to add and display interactively up to 15000 points per second (depends on the speed of the computer)
  • Panning support - just press and hold shift key while moving mouse with left button pressed
    Graph could be drawn on any device context, including printer's one

Another option is to use ready-to-go MFC or ActiveX components. Very good example of first one is "Plot Graphic Library" and an example for the second one is "GDI+ Plot ActiveX Control". As you already mentioned, all this libraries based on GDI Windows facility. BTW, you can draw this simple graph by yourself, because GDI (and GDI+) facility in Windows is very powerful.

Also, see "SoftIntegration Graphical Library (SIGL)". The library contains a lot of different plots and surfaces.

But, again, it's only about GDI. Another variant is to use DirectX or OpenGL. For the latter you should definitely try SDL (Simple DirectMedia Layer) which:

is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
As you can see it's a crossplatform library.

Good SO questions to get familiar with are:

  • "Plotting graphs in C++"
  • "Graph drawing C++ library?"
  • "Is there any 'out-of-the-box' 2D/3D plotting library for C++?"

UPDATE:

I forgot to mention "ROOT" - it is the most powerful graph library, I've ever seen. Actually, it's not a library, it's "A Data Analysis Framework". The library's creators is a guys from CERN. With this library you can build almost all kind of plots and surfaces and graphics you've ever imagined. It's crossplatform and written in C++. ROOT has both: console version (where you can write command in C++, - ROOT has own C++ compiler) and a huge set of libraries to link with your projects. You can build MFC applications with its help both in MSVS 2008 and MSVS 2010.

Binary Data in MySQL

The answer by phpguy is correct but I think there is a lot of confusion in the additional details there.

The basic answer is in a BLOB data type / attribute domain. BLOB is short for Binary Large Object and that column data type is specific for handling binary data.

See the relevant manual page for MySQL.

Can the ZedGraph charting library for .NET be recommended?

I can recommend ZedGraph. I have been using it with great
success for several years in MSQuant, for most plots: mass
spectrum display, recalibration error plots, LC peak plots,
quantitation profiles and others.

Here are some screen-shots from MSQuant where ZedGraph has
been used:

  1. Scatter plot, with trendline
  2. X-Y plot with the actual data points shown, line connection data points
  3. Sticks plot, with overlayed annotation (TextBoxes, in fact)
  4. Several plots in the same window, types as in 2. and 3. (the two plots in the bottom half)
  5. Closer look at type 2.
  6. Collage, type 2. and code in Visual Studio

The source code that is behind the first plot can be found in Source code for MSQuant: frmRecalibrationVisualisation.vb, MSQuant/msquant/src/GUI/forms/frmRecalibrationVisualisation.vb..

In contrast to many other charting libraries, ZedGraph can
also be used for scientific/math oriented plots/charts (for example,
scatter plots) and not only for business-type plots/charts.
Stock market applications may also need scatter plots.

In ZedGraph, there is built-in support for the user to zoom
in (infinite) and zoom out, pan (drag while holding down the
Ctrl key), save the plot to a file or copy it to the
clipboard.

There is one thing I am missing in ZedGraph: the ability for
the user to select items in the plot in order to perform
some action on those selected items (for example, computing some
number, accepting them as verified or marking them as
outliers to the application program).

Don't be put off by the state of ZedGraph's development.
ZedGraph is mature, is of very high quality, and can be used
as-is. There is supposed to be a new team behind its further
development.



Related Topics



Leave a reply



Submit