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

No tick numbers on a log axis plots #747

Open
tdegris opened this issue Jun 29, 2022 · 1 comment
Open

No tick numbers on a log axis plots #747

tdegris opened this issue Jun 29, 2022 · 1 comment

Comments

@tdegris
Copy link

tdegris commented Jun 29, 2022

What are you trying to do?

Plot data with labels on a log-log plot. Sometimes, no tick numbers are being displayed (depending on the data).

What did you do?

See a full example at:
https://gist.github.com/tdegris/d1844e7c209d77962ecc891b47d3a04a

Summary:

	p := plot.New()
        [...]
	p.X.Scale = plot.LogScale{}
	p.X.Tick.Marker = plot.LogTicks{}
	p.Y.Scale = plot.LogScale{}
	p.Y.Tick.Marker = plot.LogTicks{}
	p.Add(&plotter.Line{
		XYs: data,
		LineStyle: draw.LineStyle{ [...] },
	})

What did you expect to happen?

Some numbers on the ticks of the Y axis.

What actually happened?

No tick numbers on the Y axis.

noylabels

What version of Go and Gonum/plot are you using?

go version:

go version go1.18.3 darwin/arm64

gonum/plot version:

/opt/homebrew/opt/go/pkg/mod/gonum.org/v1                                                                                                                         
$ git rev-parse HEAD
fba051f98f609634ae4392d0053ddfc627f8cdb3
@kortschak
Copy link
Member

I'm not sure there is much we can do here. There is a workaround in that you can set a min and a max for the axis that will guarantee that you are picking up a major tick. So in the case here set min to 1 and max to 10.

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