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

Significant Figures #155

Closed
Bebotron opened this issue Sep 5, 2020 · 1 comment
Closed

Significant Figures #155

Bebotron opened this issue Sep 5, 2020 · 1 comment

Comments

@Bebotron
Copy link

Bebotron commented Sep 5, 2020

I couldn't find this anywhere in the examples notebook. I'm trying to manipulate the number of significant figures on my axis ticks.

I have the following data

julia> data
10×2 Array{Float64,2}:
  10.0  0.986932
  20.0  0.991782
  30.0  0.993552
  40.0  0.994498
  50.0  0.995099
  60.0  0.995522
  70.0  0.995839
  80.0  0.996087
  90.0  0.996287
 100.0  0.996454

And I'm running Plots.Scatter(data[:,1], data[:,2]), this produces the following plot

test

This y-axis is completely pointless, and I can't find how to fix it (show 3 significant figures)

@mossr
Copy link
Member

mossr commented Feb 9, 2021

This can be done through the style keyword of Axis and using standard pgfplots settings:

Axis(Plots.Scatter(data[:,1], data[:,2]), style="yticklabel style={/pgf/number format/precision=3}")

image

As a future reference, there are a lot of customizable things you can do purely in pgfplots that may not have a direct keyword in PGFPlots.jl, and we use the style option as a somewhat catch-all.

Here's more information about pgfplot precision: https://tex.stackexchange.com/questions/220969/pgfplots-significant-figures

@mossr mossr closed this as completed Feb 9, 2021
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