Stem-and-leaf plot: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
(rewording to be more generic after consultation with User:Short Circuit)
Line 5: Line 5:
XXX provide some sample data (2-3 digit integers (to avoid discussing rounding) with an interesting distribution)
XXX provide some sample data (2-3 digit integers (to avoid discussing rounding) with an interesting distribution)


The primary intent of this task is the presentation of information. It is acceptable to hardcode the data set or characteristics of it (such as what the stems are) in the example, insofar as it is impractical to make the example generic to any data set. For example, in a computation-less language like HTML the data set may be entirely prearranged within the example; the interesting characteristics are how the proper visual formatting is arranged.
For general programming languages, take the data set as a list/array of integers, sort it and convert it into the stem-and-leaf structure. For document languages [such as LaTeX, HTML, etc. -- delete this note once such examples are present], present the plot with appropriate layout, spacing, and vertical line; the sorting/grouping of the data values may be hardcoded. Examples may use a programming language to generate output in a document language, or use a graphics toolkit, or any other interesting and practical approach to the result.


The output should, if possible, not be a bitmap image. Monospaced plain text is acceptable.
The output should, if possible, not be a bitmap image. Monospaced plain text is acceptable.

Revision as of 01:22, 14 December 2009

This is an idea for a task, incomplete and with no actual examples, and so it is not yet marked with the task template. —Kevin Reid 00:27, 14 December 2009 (UTC)

Create a well-formatted stem-and-leaf plot from the following data set:

XXX provide some sample data (2-3 digit integers (to avoid discussing rounding) with an interesting distribution)

The primary intent of this task is the presentation of information. It is acceptable to hardcode the data set or characteristics of it (such as what the stems are) in the example, insofar as it is impractical to make the example generic to any data set. For example, in a computation-less language like HTML the data set may be entirely prearranged within the example; the interesting characteristics are how the proper visual formatting is arranged.

The output should, if possible, not be a bitmap image. Monospaced plain text is acceptable.