gopherdata / gopherdata/gophernotes

Error in gonum.org/v1/plot code that used to work

Ouverte
#198 11 commentaires 0 réactions 1 personne assignée Réclamée par @cosmos72 Voir sur GitHub
bug
Langage dominant
Go
Étoiles
4k
Forks
264
Merge moyen
7 j 21 h
PR mergées (30 j)
1

Description

Hi, After not using gophernotes for a month or so, something has changed so that example code for gonum.org/v1/plot no longer runs properly in gophernotes, but continues to run fine in the latest gomacro.

Reproduction from [this example code](https://godoc.org/gonum.org/v1/plot/plotter#ex-BarChart):

```golang
import (
"log"
"image/color"
"gonum.org/v1/plot"
"gonum.org/v1/plot/plotter"
"gonum.org/v1/plot/plotutil"
"gonum.org/v1/plot/vg"
)

groupA := plotter.Values{20, 35, 30, 35, 27}
groupB := plotter.Values{25, 32, 34, 20, 25}
groupC := plotter.Values{12, 28, 15, 21, 8}
groupD := plotter.Values{30, 42, 6, 9, 12}

p, err := plot.New()
if err != nil {
log.Panic(err)
}
p.Title.Text = "Bar chart"
p.Y.Label.Text = "Heights"

w := vg.Points(8)

barsA, err := plotter.NewBarChart(groupA, w)
if err != nil {
log.Panic(err)
}
barsA.Color = color.RGBA{R: 255, A: 255}
barsA.Offset = -w / 2

barsB, err := plotter.NewBarChart(groupB, w)
if err != nil {
log.Panic(err)
}
barsB.Color = color.RGBA{R: 196, G: 196, A: 255}
barsB.Offset = w / 2

barsC, err := plotter.NewBarChart(groupC, w)
if err != nil {
log.Panic(err)
}
barsC.XMin = 6
barsC.Color = color.RGBA{B: 255, A: 255}
barsC.Offset = -w / 2

barsD, err := plotter.NewBarChart(groupD, w)
if err != nil {
log.Panic(err)
}
barsD.Color = color.RGBA{B: 255, R: 255, A: 255}
barsD.XMin = 6
barsD.Offset = w / 2

p.Add(barsA, barsB, barsC, barsD)
p.Legend.Add("A", barsA)
p.Legend.Add("B", barsB)
p.Legend.Add("C", barsC)
p.Legend.Add("D", barsD)
p.Legend.Top = true
p.NominalX("Zero", "One", "Two", "Three", "Four", "",
"Six", "Seven", "Eight", "Nine", "Ten")

p.Add(plotter.NewGlyphBoxes())
err = p.Save(300, 250, "barChart2.png")
if err != nil {
log.Panic(err)
}
```

Which panics with:
```
type : inconsistent 0-th method signature:
go/types.Type has receiver and 2 parameters: func(string, ...gonum.org/v1/plot.Thumbnailer)
reflect.Type has 2 parameters: func(plot.Legend, string) vg.Length
```

The code above works fine on the latest commit of `gomacro` by itself, I only see this failure in a fresh install of gophernotes.

I've tried clearing all of the state in `~/go/pkg` and `~/go/src/gomacro.imports` but that didn't resolve anything. Has gophernotes fallen behind `gomacro` in some respect and this is a symptom?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.