TransWikia.com

pgfplot Y-Axis Log Scale For Large Decimal Numbers

TeX - LaTeX Asked by mhaken on May 22, 2021

I’m trying to plot the effects of sparing on availability, effectively this formula y = 1 - (1 - A)^x+1). A is fixed at .99. I’m trying to get the y-axis to represent data points between 99.99 and 100, but also show enough meaningful data at the top for x 1:10. I feel like this should have some kind of log scale, but can’t figure out how to achieve that. Here’s what I have so far.

begin{figure}[H]
centering
figuretitle{Sparing Effect on Availability}
begin{tikzpicture}
  begin{axis}[ 
    xlabel=Spares,
    ylabel=Availability,
    ymax=100,
    ymin=99.99,
    scaled y ticks = false,
   y tick label style={/pgf/number format/fixed, /pgf/number format/fixed zerofill, /pgf/number format/precision=8},
    xmin = 1,
    xmax = 10,
    width=.9textwidth,
    height=7cm, 
    legend style={
      at={(0.5,-0.15)},
      anchor=north,
      legend columns=-1
    },
  ] 
    addplot  [domain = 1:10, color=blue] {(1 - (1 - .99)^(x + 1)) * 100};
  end{axis}
  
end{tikzpicture}
caption{Decreasing Returns From Increased Sparing}
label{fig:sparing}
end{figure}

enter image description here

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP