bar.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * bar.h
  3. *
  4. */
  5. /*
  6. * #include "strings.h"
  7. */
  8. #include <grass/gis.h>
  9. #include "options.h"
  10. #include "dhist.h"
  11. float rem(); /* remainder function */
  12. /* normalized coordinates of bar-chart components */
  13. /* origin */
  14. #define ORIGIN_X 0.13
  15. #define ORIGIN_Y 0.28
  16. /* y-coordinate of end of y-axis */
  17. #define YAXIS_END 0.85
  18. /* x-coordinate of end of x-axis */
  19. #define XAXIS_END 0.93
  20. /* minimum distance between numbered tic-marks on x-axis */
  21. #define XTIC_DIST 40
  22. /* minimum distance between numbered tic-marks on y-axis */
  23. #define YTIC_DIST 40
  24. /* sizes of tic-marks */
  25. #define BIG_TIC 0.025
  26. #define SMALL_TIC 0.015
  27. /* y-coordinates of the two text labels */
  28. #define LABEL_1 0.10
  29. #define LABEL_2 0.03
  30. /* y-coordinate of x-axis tic-mark numbers */
  31. #define XNUMS_Y 0.20
  32. /* x-coordinate of y-axis tic-mark numbers */
  33. #define YNUMS_X 0.05
  34. /* text width and height */
  35. #define TEXT_HEIGHT 0.05
  36. #define TEXT_WIDTH TEXT_HEIGHT*0.5
  37. struct units tics[] = {
  38. {"", 1, 2},
  39. {"", 1, 5},
  40. {"in tens", 10, 10},
  41. {"in tens", 10, 20},
  42. {"in tens", 10, 50},
  43. {"in hundreds", 100, 100},
  44. {"in hundreds", 100, 500},
  45. {"in thousands", 1000, 1000},
  46. {"in thousands", 1000, 5000},
  47. {"in thousands", 1000, 10000},
  48. {"in thousands", 1000, 50000},
  49. {"in tens of thousands", 10000, 10000},
  50. {"in tens of thousands", 10000, 20000},
  51. {"in tens of thousands", 10000, 50000},
  52. {"in hundreds of thousands", 100000, 100000},
  53. {"in hundreds of thousands", 100000, 200000},
  54. {"in hundreds of thousands", 100000, 500000},
  55. {"in millions", 1000000, 1000000},
  56. {"in millions", 1000000, 2000000},
  57. {"in millions", 1000000, 5000000},
  58. {"in tens of millions", 10000000, 10000000},
  59. {"in tens of millions", 10000000, 20000000},
  60. {"in tens of millions", 10000000, 50000000},
  61. {"in hundreds of millions", 100000000, 100000000},
  62. {"in hundreds of millions", 100000000, 200000000},
  63. {"in hundreds of millions", 100000000, 500000000},
  64. {"in billions", 1000000000, 1000000000}
  65. };