﻿ DPLOTLIB User's Guide
 Navigation:  »No topics above this level« DPLOTLIB User's Guide

Last updated: 14 May 2013

DPLOTLIB functions can be called from any language that supports calling procedures in external DLL's. Simple 32-bit example programs with source code in C, C#, FORTRAN, Visual Basic, PowerBasic, FreeBASIC, VB.NET, and Delphi, and 64-bit examples in C, C#, and VB.NET are included in the distribution. Examples for each compiler are included that produce the same plots using DPlot_Plot:

 • An XY plot with 2 curves: sin(πx) and cos(πx) from x = 0 to 4.
 • A 3D contour plot of z = sin(x)*cos(y) from -3 < x < 3 and -2 < y < 2 on a rectangular grid.
 • A 2D contour plot with contour lines of z = sin(x)*cos(y) from 1000 randomly-spaced points in the range x = +π, y = +π.
 • A box-and-whisker plot with 3 groups of data.
 • A 3D scatter plot with 3 groups of data each representing random spheres.

Other examples include hiding DPlot and retrieving a bitmap or metafile of a plot to display in a window of your own application, and a real time simulation that sends data to DPlot at fixed time intervals.

All functions will work with both the evaluation and registered versions of DPlot and with DPlot Jr. Unless there are clear differences, both the full version of DPlot and DPlot Jr are referred to simply as DPlot. See the documentation on DPlot_Start for more information on which program will be used.

Getting Started

Example Programs

Data Types

DPLOT structure

Calling Convention

DPLOTLIB Functions

 DPlot_3DBorder (requires DPlot 1.9.8.3 or later) allows you to define the edges of a surface plot constructed from random 3D points. This allows you to create a surface plot with concave edges and/or holes within the surface. DPlot_AddData allows you to add data points to an existing curve or create a new curve in an existing plot. DPlot_AlwaysActivate controls whether dplot.exe is activated (BringWindowToTop) when DPlot_Command and various DPlot_Plot functions are called. DPlot_Command allows you to send one or more command strings to DPlot. This might be useful in real-time applications or other situations in which the complete data set to plot is not initially known. DPlot_GetBitmap retrieves an HBITMAP handle to a bitmap of a specified plot, usually, but not necessarily, a plot generated by the calling application. As with DPlot_PlotBitmap, it is the calling application's responsibility to draw the bitmap and delete it when it is no longer needed. DPlot_GetBitmapEx is identical to DPlot_GetBitmap, but additionally returns a structure containing plot dimensions that allow you to map pixels to X,Y coordinates in data space. See the C ctest2, C# test2, VB btest2, and/or VB.NET Project2 demos for example usage. DPlot_GetEnhMetaFile retrieves an HENHMETAFILE handle to an enhanced metafile of a specified plot, usually, but not necessarily, a plot generated by the calling application. As with DPlot_PlotBitmap, it is the calling application's responsibility to draw the metafile and delete it when it is no longer needed. See the btest4 and/or ctest4 example programs. Please note: DPlot will not produce a metafile for 3D views or for 2D views with shaded bands (ContourMethod(0)) or bands + lines (ContourMethod(6)). DPlot_GetPlotMetrics retrieves scaling information that allows you to map pixels to X,Y coordinates in data space. DPlot_GetVersion retrieves the version number of the application (DPlot or DPlot Jr) that will be launched and/or communicated with by DPlot_Start. DPlot_MinVersion Specify the minimum version of DPlot to use. Useful for developers distributing DPlot Jr when the end user might have an obsolete version of DPlot installed DPlot_Plot enables you to send data to DPlot and create a complete plot with a single function call. You can create any plot type currently supported by DPlot, including XY plots, contour plots (2D or 3D) of data organized on a rectangular grid, contour plots (2D or 3D) of randomly-spaced x,y,z triplets, 3D scatter plots, and box-and-whisker plots and dot graphs of 1D data. If you simply want your application to produce a graph, this is the only function you'll need. DPlot_PlotToRect is similar to DPlot_Plot, but hides DPlot and paints a bitmap of your plot in a rectangle specified in the calling arguments. The bitmap is not preserved in any way; if the drawing is covered up by another window and later uncovered, the drawing is... kaput. DPlot_PlotBitmap is very nearly identical to DPlot_PlotToRect, but instead of performing the drawing operation itself, it returns an HBITMAP handle to a bitmap. It is the calling application's responsibility to then draw the bitmap and delete it when it is no longer needed. DPlot_Request retrieves information from DPlot. DPlot_SetErrorMethod allows control over how error conditions are reported to the user. DPlot_Start starts DPlot, optionally hiding it from view. The function also returns a value indicating whether DPlot was already running. DPlot_Stop shuts down DPlot (depending on circumstances). DPlot_YFromX returns an interpolated Y value for a given X from a specified curve. DPlot_ZFromXY returns the Z value on a 3D surface plot for the given X and Y coordinates. See the C ctest2 and/or VB btest2 demo for example usage.

Deployment

Revision History