Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't set log scale #11

Open
bernardoaraujor opened this issue Nov 21, 2017 · 1 comment
Open

can't set log scale #11

bernardoaraujor opened this issue Nov 21, 2017 · 1 comment

Comments

@bernardoaraujor
Copy link

bernardoaraujor commented Nov 21, 2017

here's my function:

func EMLogLog(em elementary.Model){
	tfs := em.TokensNfreqs

	freqs := make([]int, 0)
	is := make([]int, 0)
	for i, tf := range tfs{
		is = append(is, i)
		freqs = append(freqs, tf.Freq)
	}

	dimensions := 2
	// The dimensions supported by the plot
	persist := false
	debug := true
	plot, _ := glot.NewPlot(dimensions, persist, debug)

	pointGroupName := "frequency"
	style := "lines"
	points := [][]int{is, freqs}
	plot.AddPointGroup(pointGroupName, style, points)

	plot.SetTitle(em.Name)

	plot.SetXLabel("Token Rank")
	plot.SetYLabel("Token Freq")

	plot.SetXrange(0, len(is))
	plot.SetYrange(0, freqs[0])

	plot.SetLogscale("x", 10)
	plot.SetLogscale("y", 10)
	//fmt.Println(err)

	plot.SavePlot("plot/plots/" + em.Name + ".png")
}

this is the debug log:

cmd> plot "/tmp/go-gnuplot-360955978" title "frequency" with lines
res> 62
cmd> set title "Exact Match:500-worst-passwords" 
res> 45
cmd> set xlabel 'Token Rank'
res> 24
cmd> set ylabel 'Token Freq'
res> 24
cmd> set xrange [0:339]
res> 19
cmd> set yrange [0:69638]
res> 21
cmd> set logscale x 10
res> 18
cmd> set logscale y 10
res> 18
cmd> set terminal png
res> 17
cmd> set output'plot/plots/Exact Match:500-worst-passwords.png'
res> 59
cmd> replot  
res> 9

Am I doing something wrong?

@szaydel
Copy link
Contributor

szaydel commented Jan 5, 2018

Do you mind offering some insight into what is happening, or not happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants