libcm is a C development framework with an emphasis on audio signal processing applications.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cmGnuPlot.h 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #ifndef cmGnuPlot_h
  2. #define cmGnuPlot_h
  3. enum
  4. {
  5. kOkPlRC,
  6. kSignalFailedPlRC,
  7. kPipeFailedPlRC,
  8. kForkFailedPlRC,
  9. kExecFailedPlRC,
  10. kPipeCloseFailedPlRC,
  11. kPlotNotFoundPlRC,
  12. kNoCurPlotPlRC,
  13. kPlotDataFileFailPlRC,
  14. kFopenFailedPlRC,
  15. kFcloseFailedPlRC
  16. };
  17. enum
  18. {
  19. kInvalidPlotPtId = 0x000,
  20. kPlusPlotPtId = 0x001,
  21. kXPlotPtId = 0x002,
  22. kAsteriskPlotPtId = 0x003,
  23. kSquarePlotPtId = 0x004,
  24. kFillSquarePlotPtId = 0x005,
  25. kCirclePlotPtId = 0x006,
  26. kFillCirclePlotPtId = 0x007,
  27. kTriPlotPtId = 0x008,
  28. kFillTriPlotPtId = 0x009,
  29. kInvTriPlotPtId = 0x00a,
  30. kInvFillTriPlotPtId = 0x00b,
  31. kDiamondPlotPtId = 0x00c,
  32. kFillDiamonPlotPtId = 0x00d,
  33. kPlotPtMask = 0x00f,
  34. };
  35. enum
  36. {
  37. kInvalidPlotLineId = 0x000, // -2 after translation
  38. kSolidPlotLineId = 0x010, // -1 after translation
  39. kDashPlotLineId = 0x020, // 0 after translation
  40. kPlotLineMask = 0x0f0,
  41. kPlotLineShift = 4
  42. };
  43. enum
  44. {
  45. kImpulsePlotFl = 0x100
  46. };
  47. /// Set terminal to NULL to use the default terminal.
  48. cmRC_t cmPlotInitialize( const char* terminalStr );
  49. // Combines initializaion and setup in a single call.
  50. cmRC_t cmPlotInitialize2( const char* terminalStr, const char* title, unsigned rowCnt, unsigned colCnt );
  51. cmRC_t cmPlotFinalize();
  52. /// Setup the plot page
  53. cmRC_t cmPlotSetup( const char* title, unsigned rowCnt, unsigned colCnt );
  54. /// Select sub-plot to apply subsequent commands to
  55. cmRC_t cmPlotSelectSubPlot( unsigned ri, unsigned ci );
  56. /// Clear the current current subplot
  57. cmRC_t cmPlotClear();
  58. /// Set the labels on the current sub-plot
  59. cmRC_t cmPlotSetLabels( const char* title, const char* xLabelStr, const char* yLabelStr, const char* zLabelStr );
  60. /// Set the default ranges for the x, y and z axes. To leave the ranges at their current values set the min and max to -1.
  61. /// The range values are used to form data sets when data is not explicitely given.
  62. cmRC_t cmPlotSetRange( double xMin, double xMax, double yMin, double yMax, double zMin, double zMax );
  63. /// If x or y is given as NULL then the values will be taken from the range settings xMin:xMax or yMin:yMax.
  64. /// Use the gnuplot command:'test' to see the valid lineType and pointType values for a given terminal
  65. /// Color string may be any of the predefined color labels: show palette colornames or and rgb value: e.g. #FF00FF
  66. cmRC_t cmPlotLineF( const char* legendStr, const float* x, const float* y, const float* z, unsigned n, const char* colorStr, unsigned styleFlags );
  67. cmRC_t cmPlotLineD( const char* legendStr, const double* x, const double* y, const double* z, unsigned n, const char* colorStr, unsigned styleFlags );
  68. cmRC_t cmPlotLineMD( const double* x, const double* y, const double* z, unsigned rn, unsigned cn, unsigned styleFlags );
  69. #if CM_FLOAT_SMP == 1
  70. #define cmPlotLineS cmPlotLineF
  71. #else
  72. #define cmPlotLineS cmPlotLineD
  73. #endif
  74. #if CM_FLOAT_REAL == 1
  75. #define cmPlotLineR cmPlotLineF
  76. #else
  77. #define cmPlotLineR cmPlotLineD
  78. #endif
  79. cmRC_t cmPlotDraw();
  80. cmRC_t cmPlotPrint( bool printDataFl );
  81. cmRC_t cmPlotDrawAndPrint( bool printDataFl );
  82. #endif