TransWikia.com

Axis lines=middle doesn't center axis in (0,0). Difference between axis lines and axis lines*

TeX - LaTeX Asked on March 14, 2021

Whenever I want axis go through (0,0) axis lines=middle works fine. But

documentclass{article}

usepackage{tikz}
usepackage{pgfplots}

pgfplotsset{compat=newest}

begin{document}
    
begin{tikzpicture} 
    begin{axis}[clip=false, axis lines = middle, xtick=empty, ytick=empty]  
          
        % CURVE
        addplot [smooth,tension=0.9] coordinates {(1,4.8)(1.5,3)(3.5,2)(5,-4)(6,3)(7,4.5)};
        
        % Pin showing where's axis intersection
        addplot [mark=x] coordinates {(1,0)} node [pin={[pin edge={black}]320:{$(1,0)$}}]{}; 

    end{axis}
end{tikzpicture}

end{document}

produces

enter image description here

Expected output:

enter image description here

I thought the difference between axis lines and axis lines* were just arrow heads. But in this example, axis lines*=middle get axis intersection at (0,0), so why axis lines=middle doesn’t ?

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