New returns a new plot with some reasonable default settings.
()
| 94 | |
| 95 | // New returns a new plot with some reasonable default settings. |
| 96 | func 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 | // |