Admin Production ni-theme
Current Publication

PlotPoint

LabWindows/CVI

PlotPoint

int PlotPoint (int panelHandle, int controlID, double xCoordinate, double yCoordinate, int pointStyle, int color);

Purpose

Plots a point onto a graph control.

Specify the position of the point in terms of x- and y-coordinates of the graph.

Supported Controls

You can use PlotPoint with graph controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl.
xCoordinate double Horizontal position at which to plot the point.
yCoordinate double Vertical coordinate at which to plot the point.
pointStyle int Point style to use when plotting the array. The point style determines the type of marker to draw when the plot style is VAL_CONNECTED_POINTS or VAL_SCATTER. The default value is VAL_EMPTY_SQUARE.

VAL_EMPTY_SQUARE An empty square.
VAL_SOLID_SQUARE A solid square.
VAL_ASTERISK An asterisk type character.
VAL_DOTTED_EMPTY_SQUARE An empty square with a dot in its center.
VAL_DOTTED_SOLID_SQUARE A solid square with a dot in its center.
VAL_SOLID_DIAMOND A diamond shape (similar to a cross).
VAL_EMPTY_SQUARE_WITH_X An empty square with an X-like shape in its center.
VAL_EMPTY_SQUARE_WITH_CROSS An empty square with a cross in its center.
VAL_BOLD_X A bold X-like shape.
VAL_SMALL_SOLID_SQUARE A small solid square.
VAL_SIMPLE_DOT A small dot.
VAL_EMPTY_CIRCLE An empty circle.
VAL_SOLID_CIRCLE A solid circle.
VAL_DOTTED_SOLID_CIRCLE A circle with a dot in its center.
VAL_DOTTED_EMPTY_CIRCLE A solid circle with a a dot in its center.
VAL_BOLD_CROSS A bold cross of equal height and width.
VAL_CROSS A cross of equal height and width.
VAL_SMALL_CROSS A small cross of equal height and width.
VAL_X An X-like shape.
VAL_SMALL_X A small X-like shape.
VAL_DOTTED_SOLID_DIAMOND A solid diamond shape with a dot in its center.
VAL_EMPTY_DIAMOND An empty diamond shape.
VAL_DOTTED_EMPTY_DIAMOND An empty solid diamond shape with a dot in its center.
VAL_SMALL_EMPTY_SQUARE A small empty square.
VAL_NO_POINT No cursor point.
color int Specifies the color of the data to plot.

An RGB value is a 4-byte integer with the hexadecimal format 0x00RRGGBB. RR, GG, and BB are the respective red, green, and blue components of the color value. The first sixteen colors in the table are the sixteen standard colors.

Value Code
VAL_RED 0xFF0000L
VAL_GREEN 0x00FF00L
VAL_BLUE 0x0000FFL
VAL_CYAN 0x00FFFFL
VAL_MAGENTA 0xFF00FFL
VAL_YELLOW 0xFFFF00L
VAL_DK_RED 0x800000L
VAL_DK_BLUE 0x000080L
VAL_DK_GREEN 0x008000L
VAL_DK_CYAN 0x008080L
VAL_DK_MAGENTA 0x800080L
VAL_DK_YELLOW 0x808000L
VAL_LT_GRAY 0xC0C0C0L
VAL_DK_GRAY 0x808080L
VAL_BLACK 0x000000L
VAL_WHITE 0xFFFFFFL
VAL_PANEL_GRAY 0xC0C0C0L
VAL_GRAY 0xA0A0A0L
VAL_OFFWHITE 0xE0E0E0L
VAL_TRANSPARENT 0x1000000L

You also can use the User Interface Library function, MakeColor, to create an RGB value from red, green, and blue color components.

To enter user-defined color values, select Options»Toggle Control Style in the function panel and manually enter the color value.

Return Value

Name Type Description
plotHandle int The handle of the new plot that you can use in subsequent function calls to reference the plot.

If the handle is positive, the new plot was successfully added to the graph. Negative values indicate that an error occurred.

Note  If ATTR_DATA_MODE is set to VAL_DISCARD, the function returns 0.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Examples

Refer to the following examples that use the PlotPoint function:

  • apps\freqresp\freqresp.cws

    Open example
  • userint\graphlegend.cws

    Open example
  • userint\graphs.cws

    Open example