Function Repository Resource:

# WinLossChart

Create a simple bar chart that shows the number of items in a list that fit set criteria compared to those that do not

Contributed by: Craig Cowley
 ResourceFunction["WinLossChart"][{item1,item2, …,itemn}] generates a win/loss chart based on the itemi.

## Details and Options

By default, positive numbers are treated as wins and non-positive numbers are treated as losses.
ResourceFunction["WinLossChart"] takes the following options:
 "WinLossPatterns" {_?Positive,_?NonPositive} patterns that correspond to wins/losses "AxisLabels" {"Wins","Losses"} y-axis chart labels "Colors" {Green,Red} colors of the bars

## Examples

### Basic Examples (2)

Generate a list of random integers:

 In[1]:=
 Out[1]=

Plot them in a win/loss chart:

 In[2]:=
 Out[2]=

### Options (3)

The win/loss criteria can be changed with the "WinLossPatterns" option:

 In[3]:=
 In[4]:=
 Out[4]=

The axis labels can be changed to better reflect the contents of the chart:

 In[5]:=
 In[6]:=
 Out[6]=

The colors of the bars can be changed:

 In[7]:=
 In[8]:=
 Out[8]=

### Properties and Relations (1)

Non-numeric data is left blank in the chart produced by WinLossChart:

 In[9]:=
 Out[9]=

### Neat Examples (1)

Compare two soccer teams' results over a season:

 In[10]:=
 Out[10]=

Craig Cowley

## Version History

• 1.0.0 – 26 February 2020

## Author Notes

Future improvements:
Make RatioPartition[list,n] equivalent to Partition[list,n] (while ensuring the "Randomize" option still works).
Make RatioPartition[n] equivalent to RandomPartition[n] (which needs Combinatorica`).