PLplot 5.15.0
Loading...
Searching...
No Matches
plplot_impl.c File Reference
#include <caml/alloc.h>
#include <caml/callback.h>
#include <caml/fail.h>
#include <caml/memory.h>
#include <caml/misc.h>
#include <caml/mlvalues.h>
#include <caml/bigarray.h>
#include <plplotP.h>
#include <plplot.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define MAX_EXCEPTION_MESSAGE_LENGTH   1000
#define CAML_PLPLOT_PLOTTER_FUNC_NAME   "caml_plplot_plotter"
#define CAML_PLPLOT_MAPFORM_FUNC_NAME   "caml_plplot_mapform"
#define CAML_PLPLOT_DEFINED_FUNC_NAME   "caml_plplot_defined"
#define CAML_PLPLOT_LABEL_FUNC_NAME   "caml_plplot_customlabel"
#define CAML_PLPLOT_ABORT_FUNC_NAME   "caml_plplot_abort"
#define CAML_PLPLOT_EXIT_FUNC_NAME   "caml_plplot_exit"
#define CAML_PLPLOT_TRANSFORM_FUNC_NAME   "caml_plplot_transform"
#define INIT_STRING_ARRAY(o)
#define INIT_NC_STRING_ARRAY(o)
#define INIT_INT_ARRAY(o)
#define INIT_INT_ARRAYS(o)

Typedefs

typedef void(* ML_PLOTTER_FUNC) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer)
typedef PLINT(* ML_DEFINED_FUNC) (PLFLT, PLFLT)
typedef void(* ML_MAPFORM_FUNC) (PLINT, PLFLT *, PLFLT *)
typedef void(* ML_LABEL_FUNC) (PLINT, PLFLT, char *, PLINT, PLPointer)
typedef PLINT(* ML_VARIANT_FUNC) (PLINT)

Functions

void ml_plotter (PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer pltr_data)
PLINT ml_defined (PLFLT x, PLFLT y)
void ml_mapform (PLINT n, PLFLT *x, PLFLT *y)
void ml_labelfunc (PLINT axis, PLFLT n, char *label, PLINT length, PLPointer d)
void ml_abort (const char *message)
int ml_exit (const char *message)
void ml_transform (PLFLT x, PLFLT y, PLFLT *xt, PLFLT *yt, PLPointer data)
ML_PLOTTER_FUNC get_ml_plotter_func ()
ML_DEFINED_FUNC get_ml_defined_func ()
ML_MAPFORM_FUNC get_ml_mapform_func ()
value ml_plslabelfunc (value unit)
value ml_plsabort (value unit)
value ml_plsexit (value unit)
value ml_plstransform (value unit)
void ml_plcont (const PLFLT **f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel)
void ml_plshade (const PLFLT **a, PLINT nx, PLINT ny, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLFLT sh_width, PLINT min_color, PLFLT min_width, PLINT max_color, PLFLT max_width, PLBOOL rectangular)
void ml_plshades (const PLFLT **a, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT *clevel, PLINT nlevel, PLFLT fill_width, PLINT cont_color, PLFLT cont_width, PLBOOL rectangular)
void ml_plimagefr (const PLFLT **idata, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax)
void ml_plvect (const PLFLT **u, const PLFLT **v, PLINT nx, PLINT ny, PLFLT scale)
void ml_plsvect_reset ()
void ml_plmap (PLCHAR_VECTOR name, PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy)
void ml_plmapline (PLCHAR_VECTOR name, PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy, PLINT_VECTOR plotentries, PLINT nplotentries)
void ml_plmapstring (PLCHAR_VECTOR name, PLCHAR_VECTOR string, PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy, PLINT_VECTOR plotentries, PLINT nplotentries)
void ml_plmaptex (PLCHAR_VECTOR name, PLFLT dx, PLFLT dy, PLFLT just, PLCHAR_VECTOR text, PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy, PLINT plotentry)
void ml_plmapfill (PLCHAR_VECTOR name, PLFLT minx, PLFLT maxx, PLFLT miny, PLFLT maxy, PLINT_VECTOR plotentries, PLINT nplotentries)
void ml_plmeridians (PLFLT dlong, PLFLT dlat, PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat)
value ml_plgriddata (value x, value y, value z, value xg, value yg, value type, value data)
value ml_plgriddata_bytecode (value *argv, int argn)
void ml_plpoly3 (PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT ndraw, PLBOOL *draw, PLBOOL ifcc)
void plplot_check_nonzero_result (int result)
int translate_parse_option (int parse_option)
int lor_ml_list (value list, ML_VARIANT_FUNC variant_f)
value ml_plparseopts (value argv, value parse_method)
value ml_plstripc (value xspec, value yspec, value xmin, value xmax, value xjump, value ymin, value ymax, value xlpos, value ylpos, value y_ascl, value acc, value colbox, value collab, value colline, value styline, value legline, value labx, value laby, value labtop)
value ml_plstripc_byte (value *argv, int argn)
int translate_legend_option (int legend_option)
int translate_colorbar_option (int colorbar_option)
int translate_position_option (int position_option)
value ml_pllegend (value opt, value position, value x, value y, value plot_width, value bg_color, value bb_color, value bb_style, value nrow, value ncolumn, value opt_array, value text_offset, value text_scale, value text_spacing, value text_justification, value text_colors, value text, value box_colors, value box_patterns, value box_scales, value box_line_widths, value line_colors, value line_styles, value line_widths, value symbol_colors, value symbol_scales, value symbol_numbers, value symbols)
value ml_pllegend_byte (value *argv, int argn)
value ml_plcolorbar (value opt, value position, value x, value y, value x_length, value y_length, value bg_color, value bb_color, value bb_style, value low_cap_color, value high_cap_color, value cont_color, value cont_width, value label_opts, value label, value axis_opts, value ticks, value sub_ticks, value values)
value ml_plcolorbar_byte (value *argv, int argn)
void ml_pltr0 (double x, double y, double *tx, double *ty)
value ml_pltr1 (value xg, value yg, value x, value y)
value ml_pltr2 (value xg, value yg, value x, value y)
int plg_current_col0 (void)
PLFLT plg_current_col1 (void)
PLFLT plgwidth (void)
PLFLT plgchrht (void)

Macro Definition Documentation

◆ CAML_PLPLOT_ABORT_FUNC_NAME

#define CAML_PLPLOT_ABORT_FUNC_NAME   "caml_plplot_abort"

Definition at line 42 of file plplot_impl.c.

◆ CAML_PLPLOT_DEFINED_FUNC_NAME

#define CAML_PLPLOT_DEFINED_FUNC_NAME   "caml_plplot_defined"

Definition at line 40 of file plplot_impl.c.

◆ CAML_PLPLOT_EXIT_FUNC_NAME

#define CAML_PLPLOT_EXIT_FUNC_NAME   "caml_plplot_exit"

Definition at line 43 of file plplot_impl.c.

◆ CAML_PLPLOT_LABEL_FUNC_NAME

#define CAML_PLPLOT_LABEL_FUNC_NAME   "caml_plplot_customlabel"

Definition at line 41 of file plplot_impl.c.

◆ CAML_PLPLOT_MAPFORM_FUNC_NAME

#define CAML_PLPLOT_MAPFORM_FUNC_NAME   "caml_plplot_mapform"

Definition at line 39 of file plplot_impl.c.

◆ CAML_PLPLOT_PLOTTER_FUNC_NAME

#define CAML_PLPLOT_PLOTTER_FUNC_NAME   "caml_plplot_plotter"

Definition at line 38 of file plplot_impl.c.

◆ CAML_PLPLOT_TRANSFORM_FUNC_NAME

#define CAML_PLPLOT_TRANSFORM_FUNC_NAME   "caml_plplot_transform"

Definition at line 44 of file plplot_impl.c.

◆ INIT_INT_ARRAY

#define INIT_INT_ARRAY ( o)
Value:
int o ## _length; \
o ## _length = Wosize_val( o ); \
int c_ ## o[o ## _length]; \
for ( i = 0; i < ( o ## _length ); i++ ) { ( c_ ## o )[i] = Int_val( Field( ( o ), i ) ); }

Definition at line 735 of file plplot_impl.c.

◆ INIT_INT_ARRAYS

#define INIT_INT_ARRAYS ( o)
Value:
int o ## _length, o ## _inner; \
o ## _length = Wosize_val( o ); \
int *c_ ## o[o ## _length]; \
for ( i = 0; i < ( o ## _length ); i++ ) { \
INIT_INT_ARRAY( o ## _subarray ); \
( c_ ## o )[i] = c_ ## o ## _subarray; \
}

Definition at line 742 of file plplot_impl.c.

◆ INIT_NC_STRING_ARRAY

#define INIT_NC_STRING_ARRAY ( o)
Value:
int o ## _length; \
o ## _length = Wosize_val( o ); \
char *c_ ## o[o ## _length]; \
for ( i = 0; i < o ## _length; i++ ) { c_ ## o[i] = String_val( Field( o, i ) ); }

Definition at line 728 of file plplot_impl.c.

◆ INIT_STRING_ARRAY

#define INIT_STRING_ARRAY ( o)
Value:
int o ## _length; \
o ## _length = Wosize_val( o ); \
const char *c_ ## o[o ## _length]; \
for ( i = 0; i < o ## _length; i++ ) { c_ ## o[i] = String_val( Field( o, i ) ); }

Definition at line 721 of file plplot_impl.c.

◆ MAX_EXCEPTION_MESSAGE_LENGTH

#define MAX_EXCEPTION_MESSAGE_LENGTH   1000

Definition at line 37 of file plplot_impl.c.

Typedef Documentation

◆ ML_DEFINED_FUNC

typedef PLINT(* ML_DEFINED_FUNC) (PLFLT, PLFLT)

Definition at line 47 of file plplot_impl.c.

◆ ML_LABEL_FUNC

typedef void(* ML_LABEL_FUNC) (PLINT, PLFLT, char *, PLINT, PLPointer)

Definition at line 49 of file plplot_impl.c.

◆ ML_MAPFORM_FUNC

typedef void(* ML_MAPFORM_FUNC) (PLINT, PLFLT *, PLFLT *)

Definition at line 48 of file plplot_impl.c.

◆ ML_PLOTTER_FUNC

typedef void(* ML_PLOTTER_FUNC) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer)

Definition at line 46 of file plplot_impl.c.

◆ ML_VARIANT_FUNC

typedef PLINT(* ML_VARIANT_FUNC) (PLINT)

Definition at line 50 of file plplot_impl.c.

Function Documentation

◆ get_ml_defined_func()

ML_DEFINED_FUNC get_ml_defined_func ( )

Definition at line 249 of file plplot_impl.c.

◆ get_ml_mapform_func()

ML_MAPFORM_FUNC get_ml_mapform_func ( )

Definition at line 266 of file plplot_impl.c.

◆ get_ml_plotter_func()

ML_PLOTTER_FUNC get_ml_plotter_func ( )

Definition at line 232 of file plplot_impl.c.

◆ lor_ml_list()

int lor_ml_list ( value list,
ML_VARIANT_FUNC variant_f )

Definition at line 751 of file plplot_impl.c.

◆ ml_abort()

void ml_abort ( const char * message)

Definition at line 169 of file plplot_impl.c.

◆ ml_defined()

PLINT ml_defined ( PLFLT x,
PLFLT y )

Definition at line 90 of file plplot_impl.c.

◆ ml_exit()

int ml_exit ( const char * message)

Definition at line 188 of file plplot_impl.c.

◆ ml_labelfunc()

void ml_labelfunc ( PLINT axis,
PLFLT n,
char * label,
PLINT length,
PLPointer d )

Definition at line 147 of file plplot_impl.c.

◆ ml_mapform()

void ml_mapform ( PLINT n,
PLFLT * x,
PLFLT * y )

Definition at line 115 of file plplot_impl.c.

◆ ml_plcolorbar()

value ml_plcolorbar ( value opt,
value position,
value x,
value y,
value x_length,
value y_length,
value bg_color,
value bb_color,
value bb_style,
value low_cap_color,
value high_cap_color,
value cont_color,
value cont_width,
value label_opts,
value label,
value axis_opts,
value ticks,
value sub_ticks,
value values )

Definition at line 989 of file plplot_impl.c.

◆ ml_plcolorbar_byte()

value ml_plcolorbar_byte ( value * argv,
int argn )

Definition at line 1068 of file plplot_impl.c.

◆ ml_plcont()

void ml_plcont ( const PLFLT ** f,
PLINT nx,
PLINT ny,
PLINT kx,
PLINT lx,
PLINT ky,
PLINT ly,
PLFLT * clevel,
PLINT nlevel )

Definition at line 380 of file plplot_impl.c.

◆ ml_plgriddata()

value ml_plgriddata ( value x,
value y,
value z,
value xg,
value yg,
value type,
value data )

Definition at line 611 of file plplot_impl.c.

◆ ml_plgriddata_bytecode()

value ml_plgriddata_bytecode ( value * argv,
int argn )

Definition at line 670 of file plplot_impl.c.

◆ ml_plimagefr()

void ml_plimagefr ( const PLFLT ** idata,
PLINT nx,
PLINT ny,
PLFLT xmin,
PLFLT xmax,
PLFLT ymin,
PLFLT ymax,
PLFLT zmin,
PLFLT zmax,
PLFLT valuemin,
PLFLT valuemax )

Definition at line 462 of file plplot_impl.c.

◆ ml_pllegend()

value ml_pllegend ( value opt,
value position,
value x,
value y,
value plot_width,
value bg_color,
value bb_color,
value bb_style,
value nrow,
value ncolumn,
value opt_array,
value text_offset,
value text_scale,
value text_spacing,
value text_justification,
value text_colors,
value text,
value box_colors,
value box_patterns,
value box_scales,
value box_line_widths,
value line_colors,
value line_styles,
value line_widths,
value symbol_colors,
value symbol_scales,
value symbol_numbers,
value symbols )

Definition at line 898 of file plplot_impl.c.

◆ ml_pllegend_byte()

value ml_pllegend_byte ( value * argv,
int argn )

Definition at line 979 of file plplot_impl.c.

◆ ml_plmap()

void ml_plmap ( PLCHAR_VECTOR name,
PLFLT minx,
PLFLT maxx,
PLFLT miny,
PLFLT maxy )

Definition at line 501 of file plplot_impl.c.

◆ ml_plmapfill()

void ml_plmapfill ( PLCHAR_VECTOR name,
PLFLT minx,
PLFLT maxx,
PLFLT miny,
PLFLT maxy,
PLINT_VECTOR plotentries,
PLINT nplotentries )

Definition at line 575 of file plplot_impl.c.

◆ ml_plmapline()

void ml_plmapline ( PLCHAR_VECTOR name,
PLFLT minx,
PLFLT maxx,
PLFLT miny,
PLFLT maxy,
PLINT_VECTOR plotentries,
PLINT nplotentries )

Definition at line 515 of file plplot_impl.c.

◆ ml_plmapstring()

void ml_plmapstring ( PLCHAR_VECTOR name,
PLCHAR_VECTOR string,
PLFLT minx,
PLFLT maxx,
PLFLT miny,
PLFLT maxy,
PLINT_VECTOR plotentries,
PLINT nplotentries )

Definition at line 537 of file plplot_impl.c.

◆ ml_plmaptex()

void ml_plmaptex ( PLCHAR_VECTOR name,
PLFLT dx,
PLFLT dy,
PLFLT just,
PLCHAR_VECTOR text,
PLFLT minx,
PLFLT maxx,
PLFLT miny,
PLFLT maxy,
PLINT plotentry )

Definition at line 559 of file plplot_impl.c.

◆ ml_plmeridians()

void ml_plmeridians ( PLFLT dlong,
PLFLT dlat,
PLFLT minlong,
PLFLT maxlong,
PLFLT minlat,
PLFLT maxlat )

Definition at line 595 of file plplot_impl.c.

◆ ml_plotter()

void ml_plotter ( PLFLT x,
PLFLT y,
PLFLT * tx,
PLFLT * ty,
PLPointer pltr_data )

Definition at line 61 of file plplot_impl.c.

◆ ml_plparseopts()

value ml_plparseopts ( value argv,
value parse_method )

Definition at line 768 of file plplot_impl.c.

◆ ml_plpoly3()

void ml_plpoly3 ( PLINT n,
PLFLT * x,
PLFLT * y,
PLFLT * z,
PLINT ndraw,
PLBOOL * draw,
PLBOOL ifcc )

Definition at line 682 of file plplot_impl.c.

◆ ml_plsabort()

value ml_plsabort ( value unit)

Definition at line 307 of file plplot_impl.c.

◆ ml_plsexit()

value ml_plsexit ( value unit)

Definition at line 326 of file plplot_impl.c.

◆ ml_plshade()

void ml_plshade ( const PLFLT ** a,
PLINT nx,
PLINT ny,
PLFLT left,
PLFLT right,
PLFLT bottom,
PLFLT top,
PLFLT shade_min,
PLFLT shade_max,
PLINT sh_cmap,
PLFLT sh_color,
PLFLT sh_width,
PLINT min_color,
PLFLT min_width,
PLINT max_color,
PLFLT max_width,
PLBOOL rectangular )

Definition at line 411 of file plplot_impl.c.

◆ ml_plshades()

void ml_plshades ( const PLFLT ** a,
PLINT nx,
PLINT ny,
PLFLT xmin,
PLFLT xmax,
PLFLT ymin,
PLFLT ymax,
PLFLT * clevel,
PLINT nlevel,
PLFLT fill_width,
PLINT cont_color,
PLFLT cont_width,
PLBOOL rectangular )

Definition at line 438 of file plplot_impl.c.

◆ ml_plslabelfunc()

value ml_plslabelfunc ( value unit)

Definition at line 285 of file plplot_impl.c.

◆ ml_plstransform()

value ml_plstransform ( value unit)

Definition at line 347 of file plplot_impl.c.

◆ ml_plstripc()

value ml_plstripc ( value xspec,
value yspec,
value xmin,
value xmax,
value xjump,
value ymin,
value ymax,
value xlpos,
value ylpos,
value y_ascl,
value acc,
value colbox,
value collab,
value colline,
value styline,
value legline,
value labx,
value laby,
value labtop )

Definition at line 790 of file plplot_impl.c.

◆ ml_plstripc_byte()

value ml_plstripc_byte ( value * argv,
int argn )

Definition at line 824 of file plplot_impl.c.

◆ ml_plsvect_reset()

void ml_plsvect_reset ( )

Definition at line 491 of file plplot_impl.c.

◆ ml_pltr0()

void ml_pltr0 ( double x,
double y,
double * tx,
double * ty )

Definition at line 1077 of file plplot_impl.c.

◆ ml_pltr1()

value ml_pltr1 ( value xg,
value yg,
value x,
value y )

Definition at line 1082 of file plplot_impl.c.

◆ ml_pltr2()

value ml_pltr2 ( value xg,
value yg,
value x,
value y )

Definition at line 1102 of file plplot_impl.c.

◆ ml_plvect()

void ml_plvect ( const PLFLT ** u,
const PLFLT ** v,
PLINT nx,
PLINT ny,
PLFLT scale )

Definition at line 481 of file plplot_impl.c.

◆ ml_transform()

void ml_transform ( PLFLT x,
PLFLT y,
PLFLT * xt,
PLFLT * yt,
PLPointer data )

Definition at line 209 of file plplot_impl.c.

◆ plg_current_col0()

int plg_current_col0 ( void )

Definition at line 1157 of file plplot_impl.c.

◆ plg_current_col1()

PLFLT plg_current_col1 ( void )

Definition at line 1163 of file plplot_impl.c.

◆ plgchrht()

PLFLT plgchrht ( void )

Definition at line 1178 of file plplot_impl.c.

◆ plgwidth()

PLFLT plgwidth ( void )

Definition at line 1170 of file plplot_impl.c.

◆ plplot_check_nonzero_result()

void plplot_check_nonzero_result ( int result)

Definition at line 688 of file plplot_impl.c.

◆ translate_colorbar_option()

int translate_colorbar_option ( int colorbar_option)

Definition at line 851 of file plplot_impl.c.

◆ translate_legend_option()

int translate_legend_option ( int legend_option)

Definition at line 832 of file plplot_impl.c.

◆ translate_parse_option()

int translate_parse_option ( int parse_option)

Definition at line 701 of file plplot_impl.c.

◆ translate_position_option()

int translate_position_option ( int position_option)

Definition at line 879 of file plplot_impl.c.