0

How to shift x-axis with labels in xy plane?. I tried by this code, but failed. it moves the x-line but their corresponding labels are not in the correct place.

  \documentclass[]{scrartcl}
    \usepackage[utf8]{inputenc} 
    \usepackage{fullpage,amsmath,tkz-base}   

    \begin{document}
    \begin{tikzpicture}
    \tkzInit[xmin=0, ymin=0, xmax=10,ymax=10,xstep=1,ystep=1] 
    \tkzAxeX[label=,xshift=2cm]
    \tkzAxeY[label=]

    \end{tikzpicture}
    \end{document}

I need to shift x and y lines with their labels.

  • 2
    I haven't fully understood your question, do you want something like the axes that go from -2 to 10 and intersect at (0,0) or simply shift the picture position in the page or what else? Could you edit your post adding a photo of the manual drawing of what you intend? – CarLaTeX Jul 20 '16 at 11:53
  • Are you after something like Tufte like axis with pgfplots? – Torbjørn T. Jul 26 '16 at 9:06
1
+50

How about that: "removing" the original axis and redraw them.

\documentclass[]{scrartcl}    
\usepackage[utf8]{inputenc}     
\usepackage{fullpage,amsmath,tkz-base}    
\usetikzlibrary{arrows}     
\begin{document}        
\begin{tikzpicture}[myaxis/.style={thin, ->, >=stealth, shorten >=-15pt}]

\tkzInit[xmin=0, ymin=0, xmax=10, ymax=10, xstep=1, ystep=1]     
\tkzAxeY[label=,style={very thin,opacity=0}]        
\tkzAxeX[label=,xshift=2cm, style={very thin,opacity=0}]        
\draw [myaxis] (2,0) -- (12, 0);
\draw [myaxis] (0,0) -- (0,10);
\end{tikzpicture}            
\end{document}

Move X-Axis

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.