GitHub Viewer
/*
* $Id: plot.h,v 1.29.2.8 2000/10/23 18:57:54 joze Exp $
*/
/* GNUPLOT - plot.h */
/*[
* Copyright 1986 - 1993, 1998 Thomas Williams, Colin Kelley
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose with or without fee is hereby granted,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation.
*
* Permission to modify the software is granted, but not the right to
* distribute the complete modified source code. Modifications are to
* be distributed as patches to the released version. Permission to
* distribute binaries produced by compiling modified sources is granted,
* provided you
* 1. distribute the corresponding source modifications from the
* released version in the form of a patch file along with the binaries,
* 2. add special version identification to distinguish your version
* in addition to the base release version number,
* 3. provide your name and address as the primary contact for the
* support of your modified version, and
* 4. retain our contact information in regard to use of the base
* software.
* Permission to distribute the released version of the source code along
* with corresponding source modifications in the form of a patch file is
* granted with same provisions 2 through 4 for binary distributions.
*
* This software is provided "as is" without express or implied warranty
* to the extent permitted by applicable law.
]*/
#ifndef GNUPLOT_PLOT_H
# define GNUPLOT_PLOT_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "syscfg.h"
#include "stdfn.h"
#ifdef USE_MOUSE
# include "mouse.h"
#endif
#define PROGRAM "G N U P L O T"
#define PROMPT "gnuplot> "
/* OS dependent constants are now defined in syscfg.h */
#define SAMPLES 100 /* default number of samples for a plot */
#define ISO_SAMPLES 10 /* default number of isolines per splot */
#define ZERO 1e-8 /* default for 'zero' set option */
#ifndef TERM
/* default terminal is "unknown"; but see init_terminal */
# define TERM "unknown"
#endif
/* avoid precompiled header conflict with redefinition */
#ifdef NEXT
# include
#else
/* Sheer, raging paranoia */
# ifdef TRUE
# undef TRUE
# endif
# ifdef FALSE
# undef FALSE
# endif
# define TRUE 1
# define FALSE 0
#endif
#ifndef __cplusplus
#undef bool
typedef unsigned int bool;
#endif
/* TRUE or FALSE */
#define TBOOLEAN bool
/* double true, used in autoscale: 1=autoscale ?min, 2=autoscale ?max */
#define DTRUE 3
/* Normally in */
#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
#ifndef M_PI_2
# define M_PI_2 1.57079632679489661923
#endif
#define DEG2RAD (M_PI / 180.0)
/* minimum size of points[] in curve_points */
#define MIN_CRV_POINTS 100
/* minimum size of points[] in surface_points */
#define MIN_SRF_POINTS 1000
/* _POSIX_PATH_MAX is too small for practical purposes */
#ifndef PATH_MAX
# ifdef HAVE_SYS_PARAM_H
# include
# endif
# ifndef MAXPATHLEN
# define PATH_MAX 1024
# else
# define PATH_MAX MAXPATHLEN
# endif
#endif
/* Minimum number of chars to represent an integer */
#define INT_STR_LEN (3*sizeof(int))
/* Concatenate a path name and a file name. The file name
* may or may not end with a "directory separation" character.
* Path must not be NULL, but can be empty
*/
#define PATH_CONCAT(path,file) \
{ char *p = path; \
p += strlen(path); \
if (p!=path) p--; \
if (*p && (*p != DIRSEP1) && (*p != DIRSEP2)) { \
if (*p) p++; *p++ = DIRSEP1; *p = NUL; \
} \
strcat (path, file); \
}
/* Macros for string concatenation */
#ifdef HAVE_STRINGIZE
/* ANSI version */
# define CONCAT(x,y) x##y
# define CONCAT3(x,y,z) x##y##z
#else
/* K&R version */
# define CONCAT(x,y) x/**/y
# define CONCAT3(x,y,z) x/**/y/**/z
#endif
/* note that MAX_LINE_LEN, MAX_TOKENS and MAX_AT_LEN do no longer limit the
size of the input. The values describe the steps in which the sizes are
extended. */
#define MAX_LINE_LEN 1024 /* maximum number of chars allowed on line */
#define MAX_TOKENS 400
#define MAX_ID_LEN 50 /* max length of an identifier */
#define MAX_AT_LEN 150 /* max number of entries in action table */
#define NO_CARET (-1)
#ifdef DOS16
# define MAX_NUM_VAR 3 /* Plotting projection of func. of max. five vars. */
#else /* not DOS16 */
# define MAX_NUM_VAR 5 /* Plotting projection of func. of max. five vars. */
#endif /* not DOS16 */
#define MAP3D_CARTESIAN 0 /* 3D Data mapping. */
#define MAP3D_SPHERICAL 1
#define MAP3D_CYLINDRICAL 2
#define CONTOUR_NONE 0 /* Where to place contour maps if at all. */
#define CONTOUR_BASE 1
#define CONTOUR_SRF 2
#define CONTOUR_BOTH 3
#define CONTOUR_KIND_LINEAR 0
#define CONTOUR_KIND_CUBIC_SPL 1
#define CONTOUR_KIND_BSPLINE 2
#define LEVELS_AUTO 0 /* How contour levels are set */
#define LEVELS_INCREMENTAL 1 /* user specified start & incremnet */
#define LEVELS_DISCRETE 2 /* user specified discrete levels */
#define ANGLES_RADIANS 0
#define ANGLES_DEGREES 1
#define NO_TICS 0
#define TICS_ON_BORDER 1
#define TICS_ON_AXIS 2
#define TICS_MASK 3
#define TICS_MIRROR 4
/* give some names to some array elements used in command.c and grap*.c
* maybe one day the relevant items in setshow will also be stored
* in arrays
*/
/* SECOND_X_AXIS = FIRST_X_AXIS + SECOND_AXES
* FIRST_X_AXIS & SECOND_AXES == 0
*/
#define FIRST_AXES 0
#define SECOND_AXES 4
#define FIRST_Z_AXIS 0
#define FIRST_Y_AXIS 1
#define FIRST_X_AXIS 2
#define SECOND_Z_AXIS 4 /* for future expansion ;-) */
#define SECOND_Y_AXIS 5
#define SECOND_X_AXIS 6
/* extend list for datatype[] for t,u,v,r though IMHO
* they are not relevant to time data [being parametric dummies]
*/
#define T_AXIS 3 /* fill gap */
#define R_AXIS 7 /* never used ? */
#define U_AXIS 8
#define V_AXIS 9
#define AXIS_ARRAY_SIZE 10
#define DATATYPE_ARRAY_SIZE 10
/* values for range_flags[] */
#define RANGE_WRITEBACK 1 /* write auto-ed ranges back to variables for autoscale */
#define RANGE_REVERSE 2 /* allow auto and reversed ranges */
/* we want two auto modes for minitics - default where minitics
* are auto for log/time and off for linear, and auto where
* auto for all graphs
* I've done them in this order so that logscale-mode can simply
* test bit 0 to see if it must do the minitics automatically.
* similarly, conventional plot can test bit 1 to see if minitics are
* required
*/
#define MINI_OFF 0
#define MINI_DEFAULT 1
#define MINI_AUTO 3
#define MINI_USER 2
/* Need to allow user to choose grid at first and/or second axes tics.
* Also want to let user choose circles at x or y tics for polar grid.
* Also want to allow user rectangular grid for polar plot or polar
* grid for parametric plot. So just go for full configurability.
* These are bitmasks
*/
#define GRID_OFF 0
#define GRID_X (1