dimanche 30 novembre 2014

Plotted line in tikz stops in middle of grid


The plotted line stops and doesn't go on till the border of the grid: enter image description here


This is my code:



\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}

\begin{document}
\begin{tikzpicture}[baseline={(current bounding box.north)}]
\draw[step=1cm,color=gray!20] (-3,-2) grid (6,6);
\draw[-] (-3,0) -- (6,0) node[right] {$x$};
\draw (0,0) node[below left] {$O$};
\draw[-] (0,-2) -- (0,6) node[above] {$y$};
\foreach \x in {-3, -2, -1, 1, 2, 3, 4, 5, 6}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north] {$\x$};
\foreach \y in {-2, -1, 1, 2, 3, 4, 5, 6}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east] {$\y$};
\draw[blue] (-2,4) node[below left] {$k$};
\draw[black] (4,5) node[above left] {$A$};
\clip (-3,-2) rectangle (6,6);
\draw[scale=1,smooth,variable=\x,blue] plot ({\x},{(-4/3)*\x});
\draw[scale=1,smooth,variable=\x,red] plot ({\x},{(3/4)*\x+2});
\draw[fill=black](4,5) circle(0.5mm);
\end{tikzpicture}

\end{document}


What can I do so the line goes on the border of the grid??





Aucun commentaire:

Enregistrer un commentaire