JBAR
Bar Graphs in ASCII PPM format
JBAR
is a FORTRAN90 program which
reads in a data file and creates an ASCII PPM graphics file
containing a bar graph version of the data.
The data actually represents measurements, on various days of the year,
of the time required by individual "hops" in an Internet connection.
Usage:
jbar file.dat title file.ppm
-
file.dat
-
the name of an input data file, formatted as described
in routine DATA_READ; the extension "DAT" determines the
type of data:
-
'current', weekly data from today back;
-
8 characters long, 'YYYMMDD', weekly data from YYYY/MM/DD back;
-
6 characters long, 'YYYYMM', monthly data;
-
4 characters long, 'YYYY', or other, yearly data is assumed.
-
title
-
a brief title to display on the graph;
-
file.ppm
-
the name of the ASCII PPM (ASCII portable pixel map) file
in which the created graph should be stored; If this filename
is omitted, then it will normally be constructed by replacing
the extension of the input data file by ".ppm".
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
JBAR is available in
a FORTRAN90 version.
Related Data and Programs:
CALPAK,
a FORTRAN90 library which
converts between dates as computed on various calendars.
TABLE_HISTOGRAM,
a FORTRAN90 program which
can make a histogram of a set of points
stored in a table file.
Source Code:
Examples and Tests:
-
stats.1999, data over a year;
-
stats.1999.ppm,
a PPMA plot of stats.1999;
-
stats.1999.png,
a PNG version of the plot;
-
stats.199910, data over a month;
-
stats.199910.ppm,
a PPMA plot of stats.199910;
-
stats.199910.png,
a PNG version of the plot;
-
stats.19991031, data over a week;
-
stats.19991031.ppm,
a PPMA plot of stats.19991031;
-
stats.19991031.png,
a PNG version of the plot;
-
stats.current, data for the current week;
-
stats.current.ppm,
a PPMA plot of stats.current;
-
stats.current.png,
a PNG version of the plot;
List of Routines:
-
MAIN reads in a data file and creates a bar graph in PPMA format.
-
BITCHR75 returns a 7 by 5 bit pattern for a given character.
-
CH_CAP capitalizes a single character.
-
CH_EQI is a case insensitive comparison of two characters for equality.
-
CH_TO_DIGIT returns the integer value of a base 10 digit.
-
CHRLAB makes an index array for an array of (repeated) strings.
-
COLOR_SET sets RGB colors for each unique item in the bar graph.
-
DATA_READ reads in data for a bar plot.
-
DATA_WRITE prints out the data for a bar plot.
-
DAY_BORROW_COMMON borrows days from months in a common date.
-
DAY_CARRY_COMMON carries days to months in a common date.
-
DBAR_TO_X converts a date into an appropriate X coordinate.
-
FILE_EXT determines the "extension" of a file name.
-
GET_UNIT returns a free FORTRAN unit number.
-
HOUR_BORROW "borrows" a day of hours.
-
HOUR_CARRY is given a YMDH date, and carries hours to days.
-
HEXCOL returns a color on the perimeter of the color hexagon.
-
I_MODP returns the positive remainder when I is divided by J.
-
I_RANDOM returns a random integer in a given range.
-
I_SWAP swaps two integers.
-
INIT initializes the data.
-
MINUTE_BORROW "borrows" an hour of minutes.
-
MINUTE_CARRY is given a YMDHMS date, and carries minutes to hours.
-
MONTH_BORROW "borrows" a year of months while M is nonpositive.
-
MONTH_CARRY is given a YM date, and carries months to years.
-
MONTH_LENGTH_COMMON returns the number of days in a given common month.
-
MONTH_NAME_TO_MONTH returns the month number of a given month
-
MONTH_PLOT sets the RGB data for a bar graph of a month's data.
-
MONTH_TO_MONTH_NAME returns the name of a given month.
-
PERM_RANDOM2 selects a random permutation of N elements.
-
PPM_CHECK_DATA checks pixel data.
-
PPMA_WRITE writes an ASCII portable pixel map file.
-
R_TO_I maps real X in [XMIN, XMAX] to integer IX in [IXMIN, IXMAX].
-
S_CAP replaces any lowercase letters by uppercase ones in a string.
-
S_EQI is a case insensitive comparison of two strings for equality.
-
S_INDEX_LAST finds the LAST occurrence of a given substring.
-
S_TO_HMS converts a string into a H:M:S date.
-
S_TO_I reads an integer value from a string.
-
S_TO_R reads a real number from a string.
-
S_TO_YMD converts a string into a YMD date.
-
S_TO_YMDHMS converts a string into a YMD H:M:S date.
-
SECOND_BORROW "borrows" a minute of seconds.
-
SECOND_CARRY is given a YMDHMS date, and carries seconds to minutes.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
WEEK_PLOT sets the RGB data for a bar graph of a week's data.
-
WORD_NEXT finds the next (blank separated) word in a string.
-
X_SORT rearranges the data so that the X values are increasing.
-
X_WRITE prints out the X data for the plot.
-
Y_SORT sorts the Y data in each bar so that it is increasing.
-
YEAR_CHECK checks a year for reasonableness.
-
YEAR_IS_LEAP_COMMON returns TRUE if the given common year was a leap year.
-
YEAR_LENGTH_COMMON returns the number of days in a given common year.
-
YEAR_PLOT sets the RGB data for the bar graph of a year's data.
-
YM_CHECK_COMMON checks a YM date for reasonableness.
-
YMD_CHECK_COMMON checks a common YMD date for reasonableness.
-
YMDHMS_CHECK checks an YMDHMS date for reasonableness.
-
YMDHMS_COMPARE compares two YMDHMS dates.
-
YMDHMS_DIF_DHMS computes the DHMS difference between two YMDHMS dates.
-
YMDHMS_SWAP swaps the data defining two YMDHMS dates.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 08 December 2007.