<commit_before>#----------------------------------------------------------------------------
# "plot" proc.
#
# A minimal implementation of the GNUPLOT "plot" command.
#----------------------------------------------------------------------------

proc plot {file {title {}}} {

# Open and read file

    set fileid [open $file]
    set contents [read $fileid]

# Fill up the data arrays

    set n [expr [llength $contents] / 2]
    matrix x f $n
    matrix y f $n

    for {set i 0} {$i < $n} {incr i} {
	x $i = [lindex $contents [expr 2*$i]]
	y $i = [lindex $contents [expr 2*$i+1]]
    }

# Get data min/max

    set xmin [x 0]; set xmax [x 0]
    set ymin [y 0]; set ymax [y 0]

    for {set i 1} {$i < $n} {incr i} {
	if {[expr [x $i] < $xmin]} then {set xmin [x $i]}
	if {[expr [x $i] > $xmax]} then {set xmax [x $i]}
	if {[expr [y $i] < $ymin]} then {set ymin [y $i]}
	if {[expr [y $i] > $ymax]} then {set ymax [y $i]}
    }

# Set up the plot

    plcol 1
    plenv $xmin $xmax $ymin $ymax 0 0
    plcol 2
    pllab "x" "y" "$title"

# Plot the data

    plcol 3
    plline $n x y

# An eop is nice here.

    pleop
}<commit_msg>Eliminated pause at end of page on xwin devices.<commit_after>#----------------------------------------------------------------------------
# "plot" proc.
#
# A minimal implementation of the GNUPLOT "plot" command.
#----------------------------------------------------------------------------

proc plot {file {title {}}} {

# Turn off pause on xwin devices since it's really not necessary for a
# single plot application.

    plgdev device
    switch $device {
	xwin	-
	tk	-
	dp	{plspause 0}
    }

# Open and read file

    set fileid [open $file]
    set contents [read $fileid]

# Fill up the data arrays

    set n [expr [llength $contents] / 2]
    matrix x f $n
    matrix y f $n

    for {set i 0} {$i < $n} {incr i} {
	x $i = [lindex $contents [expr 2*$i]]
	y $i = [lindex $contents [expr 2*$i+1]]
    }

# Get data min/max

    set xmin [x 0]; set xmax [x 0]
    set ymin [y 0]; set ymax [y 0]

    for {set i 1} {$i < $n} {incr i} {
	if {[expr [x $i] < $xmin]} then {set xmin [x $i]}
	if {[expr [x $i] > $xmax]} then {set xmax [x $i]}
	if {[expr [y $i] < $ymin]} then {set ymin [y $i]}
	if {[expr [y $i] > $ymax]} then {set ymax [y $i]}
    }

# Set up the plot

    plcol 1
    plenv $xmin $xmax $ymin $ymax 0 0
    plcol 2
    pllab "x" "y" "$title"

# Plot the data

    plcol 3
    plline $n x y

# End the page (see note about pause above).

    pleop
}
{'fraction_non_alphanumeric': 0.25688073394495414, 'fraction_numerical': 0.012365376944555246, 'mean_word_length': 1.6455696202531647, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '620231', 'n_tokens_mistral': 970, 'n_tokens_neox': 919, 'n_words': 370}