(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     12512,        426]
NotebookOptionsPosition[      7249,        293]
NotebookOutlinePosition[      7639,        310]
CellTagsIndexPosition[      7596,        307]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["EPM`StemPlots`", "Section",
 InitializationGroup->True],

Cell[TextData[{
 StyleBox["From",
  FontWeight->"Bold"],
 ": Essentials of Programming in ",
 StyleBox["Mathematica\n",
  FontSlant->"Italic"],
 "\[Copyright] Paul R. Wellin 2015"
}], "Text",
 CellMargins->{{28, 10}, {7, 7}},
 FontSize->14],

Cell[CellGroupData[{

Cell["Metadata", "Subsection"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Name", ":", " ", "EPM`StemPlots`"}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Book", ":", " ", 
   RowBox[{
   "Essentials", " ", "of", " ", "Programming", " ", "in", " ", 
    "Mathematica"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Author", ":", " ", 
    RowBox[{"Paul", " ", "Wellin"}]}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Summary", ":", " ", 
   RowBox[{
   "This", " ", "package", " ", "contains", " ", "the", " ", "functions", " ",
     "defined", " ", "in", " ", "Chapter", " ", "6", " ", "Programs"}]}], " ",
   "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Context", ":", " ", "EPM`StemPlots`"}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Package", " ", 
    RowBox[{"Version", ":", " ", "1.0"}]}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{":", "Copyright", ":", " ", 
    RowBox[{"Copyright", " ", "2015"}]}], ",", " ", 
   RowBox[{"Paul", " ", "R", " ", "Wellin"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{
   RowBox[{":", 
    RowBox[{"History", ":", " ", 
     RowBox[{
     "Version", " ", "1.0", " ", "by", " ", "Paul", " ", "Wellin"}]}]}], ",", 
   " ", 
   RowBox[{"Dec", " ", "2012"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Keywords", ":", " ", 
   RowBox[{"stem", " ", "plots"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", "Source", ":", " ", 
   RowBox[{"StemPlots", ".", "nb"}]}], " ", "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{":", 
   RowBox[{"Mathematica", " ", "Version"}], ":", " ", "10.3"}], " ", 
  "*)"}]], "Input"],

Cell[BoxData[
 RowBox[{"(*", " ", 
  RowBox[{"Tested", " ", "in", " ", "Mathematica", " ", "11.1"}], " ", 
  "*)"}]], "Input",ExpressionUUID->"f695ddda-4832-45f2-a1d7-28430d3f4ff9"]
}, Closed]],

Cell[CellGroupData[{

Cell["BeginPackage", "Subsection"],

Cell[BoxData[
 RowBox[{"Remove", "[", "StemPlot", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"BeginPackage", "[", "\"\<EPM`StemPlots`\>\"", "]"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Usage messages for public functions", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"StemPlot", "::", "usage"}], "=", "\"\<StemPlot[\!\(\*
StyleBox[\"data\", \"TI\"]\)] returns a stem plot of the discrete data, \
\!\(\*
StyleBox[\"data\", \"TI\"]\).\>\""}], ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Warning messages", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"StemPlot", "::", "badarg"}], "=", 
   "\"\<The first argument to StemPlot must be a list of numbers.\>\""}], 
  ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Options", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"Options", "[", "StemPlot", "]"}], "=", 
   RowBox[{"Options", "[", "ListPlot", "]"}]}], ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Private context", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"Begin", "[", "\"\<`Private`\>\"", "]"}], ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Function definitions (public and private)", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"StemPlot", "[", 
   RowBox[{"lis_", ",", 
    RowBox[{"opts", ":", 
     RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", 
  "\[IndentingNewLine]", 
  RowBox[{"If", "[", 
   RowBox[{
    RowBox[{"MatchQ", "[", 
     RowBox[{"lis", ",", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"__", "?", "NumericQ"}], "}"}], "|", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"__", "?", "NumericQ"}], "}"}], ".."}], "}"}]}]}], "]"}], 
    ",", "\[IndentingNewLine]", 
    RowBox[{"ListPlot", "[", 
     RowBox[{"lis", ",", "opts", ",", 
      RowBox[{"Filling", "\[Rule]", "Axis"}]}], "]"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"Message", "[", 
     RowBox[{"StemPlot", "::", "badarg"}], "]"}]}], "\[IndentingNewLine]", 
   "]"}]}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["End private context", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"End", "[", "]"}], ";"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["EndPackage", "Subsection"],

Cell[BoxData[
 RowBox[{"EndPackage", "[", "]"}]], "Input"]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Examples", "Section"],

Cell[CellGroupData[{

Cell["Load package", "Subsection"],

Cell["Quit current session:", "Text"],

Cell[BoxData["Quit"], "Input",ExpressionUUID->"d6ab19bb-f4fa-4bee-b3b3-b722469230f8"],

Cell[TextData[{
 "Load package (do ",
 StyleBox["not",
  FontSlant->"Italic"],
 " say \[OpenCurlyDoubleQuote]Yes\[CloseCurlyDoubleQuote] to evaluate init \
cells dialog)."
}], "Text"],

Cell[BoxData[
 RowBox[{"<<", "EPM`StemPlots`"}]], "Input",ExpressionUUID->"e1dbb1cc-7fa4-4a4e-9c9a-acc80a407469"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Test usage messages", "Subsection"],

Cell[BoxData[
 RowBox[{"?", "StemPlot"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["Exercise the functions and options", "Subsection"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"data", "=", 
   RowBox[{"RandomInteger", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "5"}], ",", "10"}], "}"}], ",", "12"}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"StemPlot", "[", "data", "]"}]}], "Input",ExpressionUUID->"5f9c6bff-\
56c4-49f6-8a73-72a5c4d5a260"],

Cell[BoxData[
 RowBox[{"StemPlot", "[", 
  RowBox[{"data", ",", 
   RowBox[{"PlotTheme", "\[Rule]", "\"\<Business\>\""}], ",", 
   RowBox[{"PlotStyle", "\[Rule]", "28"}]}], "]"}]], "Input",ExpressionUUID->\
"66f318d5-790e-463f-b237-b7aa64a527d5"],

Cell["Multiple data sets:", "Text"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"data", "=", 
   RowBox[{"RandomInteger", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "5"}], ",", "10"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"2", ",", "12"}], "}"}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"StemPlot", "[", "data", "]"}]}], "Input",ExpressionUUID->"dd01ffe0-\
06fd-447f-85c0-0fa1237db7a3"]
}, Closed]]
}, Open  ]]
},
AutoGeneratedPackage->Automatic,
WindowSize->{798, 720},
WindowMargins->{{Automatic, 870}, {Automatic, 153}},
FrontEndVersion->"11.1 for Mac OS X x86 (32-bit, 64-bit Kernel) (March 16, \
2017)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[579, 22, 61, 1, 64, "Section", "ExpressionUUID" -> \
"da4e6a40-a01f-4335-9343-279b72db1620",
 InitializationGroup->True],
Cell[643, 25, 240, 9, 49, "Text", "ExpressionUUID" -> \
"725a0613-7de9-4614-82ff-5f9f32573b7b"],
Cell[CellGroupData[{
Cell[908, 38, 30, 0, 44, "Subsection", "ExpressionUUID" -> \
"2f0beffa-7a64-4757-98f7-d216c88ec231"],
Cell[941, 40, 110, 2, 32, "Input", "ExpressionUUID" -> \
"faa39528-100a-4f07-aa45-7c31f01025a4"],
Cell[1054, 44, 191, 5, 32, "Input", "ExpressionUUID" -> \
"18766c25-46b4-4d55-8f4f-2ffa3afad138"],
Cell[1248, 51, 146, 4, 32, "Input", "ExpressionUUID" -> \
"86326a8c-05e6-4a9c-9ca4-5653f9ad4d3c"],
Cell[1397, 57, 262, 6, 32, "Input", "ExpressionUUID" -> \
"3e489d70-0ce7-4896-a652-697092e3989f"],
Cell[1662, 65, 113, 2, 32, "Input", "ExpressionUUID" -> \
"f3b5a4af-a77d-476c-9fac-7ee3d2efcfd7"],
Cell[1778, 69, 147, 4, 32, "Input", "ExpressionUUID" -> \
"e830ec3c-2e97-4c7b-8f21-41d5951a7ae3"],
Cell[1928, 75, 209, 5, 32, "Input", "ExpressionUUID" -> \
"7c204971-22c5-4f69-97ba-fe32f130739a"],
Cell[2140, 82, 256, 8, 32, "Input", "ExpressionUUID" -> \
"04384a00-f80a-4ec9-bacb-4744006ba958"],
Cell[2399, 92, 132, 3, 32, "Input", "ExpressionUUID" -> \
"a2ddf466-8b11-45d1-9b38-f2d3b52b289f"],
Cell[2534, 97, 132, 3, 32, "Input", "ExpressionUUID" -> \
"d8602cf4-408c-4242-b2c3-36c7c2b7e507"],
Cell[2669, 102, 140, 4, 32, "Input", "ExpressionUUID" -> \
"3248ac6d-ace4-4134-aa8c-48698d99e156"],
Cell[2812, 108, 181, 3, 32, "Input", "ExpressionUUID" -> \
"f695ddda-4832-45f2-a1d7-28430d3f4ff9"]
}, Closed]],
Cell[CellGroupData[{
Cell[3030, 116, 34, 0, 36, "Subsection", "ExpressionUUID" -> \
"75b5e199-7508-4c51-9cc5-5780b5fd71d9"],
Cell[3067, 118, 66, 1, 32, "Input", "ExpressionUUID" -> \
"59303e04-35d7-4cdc-845c-ad3b8eed321a"],
Cell[3136, 121, 86, 1, 32, "Input", "ExpressionUUID" -> \
"e7bf43a9-cc6f-40ad-b107-a6948e4ffcb5"]
}, Closed]],
Cell[CellGroupData[{
Cell[3259, 127, 57, 0, 36, "Subsection", "ExpressionUUID" -> \
"6d401d9d-e379-4476-a3ba-be7949ba1727"],
Cell[3319, 129, 236, 6, 32, "Input", "ExpressionUUID" -> \
"1c3a2519-0744-4303-965a-b3163e6889f3"]
}, Closed]],
Cell[CellGroupData[{
Cell[3592, 140, 38, 0, 36, "Subsection", "ExpressionUUID" -> \
"b6dc0c01-5ed5-4134-a31c-3e1838dcfb5e"],
Cell[3633, 142, 175, 5, 28, "Input", "ExpressionUUID" -> \
"440e982b-d2af-4b29-8bd2-1902dd06a82f"]
}, Closed]],
Cell[CellGroupData[{
Cell[3845, 152, 29, 0, 36, "Subsection", "ExpressionUUID" -> \
"36c42b6d-3686-4502-9947-bc880061299c"],
Cell[3877, 154, 151, 4, 28, "Input", "ExpressionUUID" -> \
"7a5ba265-276a-4595-b84a-c3f371644124"]
}, Closed]],
Cell[CellGroupData[{
Cell[4065, 163, 37, 0, 36, "Subsection", "ExpressionUUID" -> \
"adf51c61-e6fd-4dc2-913d-4a8a5d0dc5de"],
Cell[4105, 165, 92, 2, 28, "Input", "ExpressionUUID" -> \
"1debec01-5ae4-459d-b364-52ece01c5d06"]
}, Closed]],
Cell[CellGroupData[{
Cell[4234, 172, 63, 0, 36, "Subsection", "ExpressionUUID" -> \
"3be3a157-8a2b-4926-832a-1b0d77130f50"],
Cell[4300, 174, 823, 25, 98, "Input", "ExpressionUUID" -> \
"9fc2c08a-6860-47a2-98bf-cdc2e460a33f"]
}, Closed]],
Cell[CellGroupData[{
Cell[5160, 204, 41, 0, 36, "Subsection", "ExpressionUUID" -> \
"8b986643-55f0-4a4d-a34a-ddd260800ba6"],
Cell[5204, 206, 69, 2, 28, "Input", "ExpressionUUID" -> \
"d9529413-2b3a-481b-925f-ae242876cecd"]
}, Closed]],
Cell[CellGroupData[{
Cell[5310, 213, 32, 0, 36, "Subsection", "ExpressionUUID" -> \
"3d6fd33a-d4d7-43cf-a9f6-912bd472154c"],
Cell[5345, 215, 58, 1, 28, "Input", "ExpressionUUID" -> \
"5892ae4d-442d-4bff-a4d5-7685d04834ea"]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[5452, 222, 27, 0, 64, "Section", "ExpressionUUID" -> \
"775b17d7-52a0-41be-9897-b4d377e1648d"],
Cell[CellGroupData[{
Cell[5504, 226, 34, 0, 44, "Subsection", "ExpressionUUID" -> \
"83f56422-6a78-4f8b-92b1-5c5d22a187d9"],
Cell[5541, 228, 37, 0, 30, "Text", "ExpressionUUID" -> \
"3353c1f9-7ab3-480e-9227-769ad4b3e599"],
Cell[5581, 230, 85, 0, 32, "Input", "ExpressionUUID" -> \
"d6ab19bb-f4fa-4bee-b3b3-b722469230f8"],
Cell[5669, 232, 183, 6, 30, "Text", "ExpressionUUID" -> \
"b3f5bc79-5870-43b3-a49f-e88554f9c37f"],
Cell[5855, 240, 113, 1, 32, "Input", "ExpressionUUID" -> \
"e1dbb1cc-7fa4-4a4e-9c9a-acc80a407469"]
}, Open  ]],
Cell[CellGroupData[{
Cell[6005, 246, 41, 0, 44, "Subsection", "ExpressionUUID" -> \
"e39f7444-5ecb-4801-8fdf-c574bfbb81b1"],
Cell[6049, 248, 51, 1, 32, "Input", "ExpressionUUID" -> \
"2dec5202-0a04-4472-abcd-6146f32e68f8"]
}, Closed]],
Cell[CellGroupData[{
Cell[6137, 254, 56, 0, 36, "Subsection", "ExpressionUUID" -> \
"9a1c2c81-0a65-43c5-9f47-5255d94ea0d1"],
Cell[6196, 256, 341, 10, 54, "Input", "ExpressionUUID" -> \
"5f9c6bff-56c4-49f6-8a73-72a5c4d5a260"],
Cell[6540, 268, 246, 5, 32, "Input", "ExpressionUUID" -> \
"66f318d5-790e-463f-b237-b7aa64a527d5"],
Cell[6789, 275, 35, 0, 30, "Text", "ExpressionUUID" -> \
"0e3cd1a1-f6e6-4e4e-ac71-d4b69134eb56"],
Cell[6827, 277, 394, 12, 54, "Input", "ExpressionUUID" -> \
"dd01ffe0-06fd-447f-85c0-0fa1237db7a3"]
}, Closed]]
}, Open  ]]
}
]
*)

