MCPcopy
hub / github.com/gonum/plot / New

Function New

plot.go:96–113  ·  view source on GitHub ↗

New returns a new plot with some reasonable default settings.

()

Source from the content-addressed store, hash-verified

94
95// New returns a new plot with some reasonable default settings.
96func New() *Plot {
97 hdlr := DefaultTextHandler
98 p := &Plot{
99 BackgroundColor: color.White,
100 X: makeAxis(horizontal),
101 Y: makeAxis(vertical),
102 Legend: newLegend(hdlr),
103 TextHandler: hdlr,
104 }
105 p.Title.TextStyle = text.Style{
106 Color: color.Black,
107 Font: font.From(DefaultFont, 12),
108 XAlign: draw.XCenter,
109 YAlign: draw.YTop,
110 Handler: hdlr,
111 }
112 return p
113}
114
115// Add adds a Plotters to the plot.
116//

Callers 15

TestIssue514Function · 0.92
TestDrawGlyphBoxesFunction · 0.92
ExampleAlignFunction · 0.92
ExampleLabelsFunction · 0.92
ExampleContourFunction · 0.92
TestFieldDimsFunction · 0.92
ExampleScatter_colorFunction · 0.92
ExampleBoxPlotFunction · 0.92
ExampleQuartPlotFunction · 0.92
ExampleFieldFunction · 0.92

Calls 3

FromFunction · 0.92
makeAxisFunction · 0.85
newLegendFunction · 0.85

Tested by 15

TestIssue514Function · 0.74
TestDrawGlyphBoxesFunction · 0.74
ExampleAlignFunction · 0.74
ExampleLabelsFunction · 0.74
ExampleContourFunction · 0.74
TestFieldDimsFunction · 0.74
ExampleScatter_colorFunction · 0.74
ExampleBoxPlotFunction · 0.74
ExampleQuartPlotFunction · 0.74
ExampleFieldFunction · 0.74