@@ -22,10 +22,7 @@ func ExampleBarChart() {
2222 horizontalLabels := []string {"Label A" , "Label B" , "Label C" , "Label D" }
2323
2424 // Create a vertical BarChart
25- p1 , err := plot .New ()
26- if err != nil {
27- log .Panic (err )
28- }
25+ p1 := plot .New ()
2926 verticalBarChart , err := plotter .NewBarChart (values , 0.5 * vg .Centimeter )
3027 if err != nil {
3128 log .Panic (err )
@@ -38,10 +35,7 @@ func ExampleBarChart() {
3835 }
3936
4037 // Create a horizontal BarChart
41- p2 , err := plot .New ()
42- if err != nil {
43- log .Panic (err )
44- }
38+ p2 := plot .New ()
4539 horizontalBarChart , err := plotter .NewBarChart (values , 0.5 * vg .Centimeter )
4640 horizontalBarChart .Horizontal = true // Specify a horizontal BarChart.
4741 if err != nil {
@@ -60,10 +54,7 @@ func ExampleBarChart() {
6054 groupC := plotter.Values {12 , 28 , 15 , 21 , 8 }
6155 groupD := plotter.Values {30 , 42 , 6 , 9 , 12 }
6256
63- p , err := plot .New ()
64- if err != nil {
65- log .Panic (err )
66- }
57+ p := plot .New ()
6758 p .Title .Text = "Bar chart"
6859 p .Y .Label .Text = "Heights"
6960
@@ -115,10 +106,7 @@ func ExampleBarChart() {
115106 }
116107
117108 // Now, make a stacked BarChart.
118- p , err = plot .New ()
119- if err != nil {
120- log .Panic (err )
121- }
109+ p = plot .New ()
122110 p .Title .Text = "Bar chart"
123111 p .Y .Label .Text = "Heights"
124112
@@ -243,10 +231,7 @@ func ExampleBarChart_positiveNegative() {
243231 log .Panic (err )
244232 }
245233
246- p , err := plot .New ()
247- if err != nil {
248- log .Panic (err )
249- }
234+ p := plot .New ()
250235 p .Add (zero , pos1 , pos2 , neg1 , neg2 , netDots )
251236 p .NominalY ("Alpha" , "Bravo" , "Charlie" , "Echo" , "Foxtrot" , "Golf" )
252237
0 commit comments