NominalY is like NominalX, but for the Y axis.
(names ...string)
| 478 | |
| 479 | // NominalY is like NominalX, but for the Y axis. |
| 480 | func (p *Plot) NominalY(names ...string) { |
| 481 | p.Y.Tick.Width = 0 |
| 482 | p.Y.Tick.Length = 0 |
| 483 | p.Y.Width = 0 |
| 484 | p.X.Padding = p.Y.Tick.Label.Height(names[0]) / 2 |
| 485 | ticks := make([]Tick, len(names)) |
| 486 | for i, name := range names { |
| 487 | ticks[i] = Tick{float64(i), name} |
| 488 | } |
| 489 | p.Y.Tick.Marker = ConstantTicks(ticks) |
| 490 | } |
| 491 | |
| 492 | // WriterTo returns an io.WriterTo that will write the plot as |
| 493 | // the specified image format. |