Graphics, Figures & TablesUnable to show my ticks

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Giacomeeno
Posts: 1
Joined: Mon May 15, 2023 11:04 pm

Unable to show my ticks

Post by Giacomeeno »

As the title say, I am not able to make my personalized ticks visible

Code: Select all

\documentclass{standalone}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}

\usetikzlibrary{positioning}
\pgfplotsset{compat=newest, ticks=none}

\begin{document}

	\begin{tikzpicture}
	    \begin{axis}[
	        axis lines = middle,
	        xmin = -8, xmax = 8,
	        ymin = -8, ymax = 8,
	        axis equal,
	        xlabel = {$\sigma$},
	        ylabel = {$\tau$},
            xtick = {-4, 0, 6},
            xticklabels = {$\sigma_{III}$, $\sigma_{II}$, $\sigma_{I}$},
            xticklabel style = {anchor = north},
            xmajorgrids = true
	        ]
	        \draw (axis cs: -2, 0) circle [radius = 2];
	        \draw (axis cs: 3, 0) circle [radius = 3];
	        \draw (axis cs: 1, 0) circle [radius = 5];
	    \end{axis}
	\end{tikzpicture}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Unable to show my ticks

Post by Bartman »

Code: Select all

\documentclass{standalone}
\usepackage{pgfplots}% loads tikz that loads graphicx

\pgfplotsset{
    compat=newest, 
    ytick=\empty% replaced ticks=none
}

\begin{document}
	\begin{tikzpicture}
	    \begin{axis}[
	        axis lines = middle,
            hide obscured x ticks=false,% added
	        xmin = -8, xmax = 8,
	        ymin = -8, ymax = 8,
	        axis equal,
	        xlabel = {$\sigma$},
	        ylabel = {$\tau$},
            xtick = {-4, 0, 6},
            xticklabels = {
                $\sigma_{\mathrm{III}}$, 
                $\sigma_{\mathrm{II}}$, 
                $\sigma_{\mathrm{I}}$
            },
            xmajorgrids
	    ]
            % Read section 2.2.1 "New Optional Features", 
            % why "axis cs" is no longer needed.
	        \draw 
                (-2, 0) circle [radius = 2]
                (3, 0) circle [radius = 3]
                (1, 0) circle [radius = 5]
            ;
	    \end{axis}
	\end{tikzpicture}
\end{document}
Post Reply