1

I have drawn a coordinate with an angle of 30 degrees betwenn the x- and the y- axis like this:

\documentclass[border=3mm,tikz]{standalone}
\usetikzlibrary{arrows}

\begin{document}

\newcommand{\xangle}{30}
\newcommand{\yangle}{60}
\newcommand{\zangle}{45}

\newcommand{\xlength}{1}
\newcommand{\ylength}{1.7}

\pgfmathsetmacro{\xx}{\xlength*cos(\xangle)}
\pgfmathsetmacro{\xy}{\xlength*sin(\xangle)}
\pgfmathsetmacro{\yx}{\ylength*cos(\yangle)}
\pgfmathsetmacro{\yy}{\ylength*sin(\yangle)}

\begin{tikzpicture}
[   x={(\xx cm,\xy cm)},
    y={(\yx cm,\yy cm)},
%    z={(\zx cm,\zy cm)},
]
\draw[-latex,red] (-1,0,0) -- (3.5,0,0) node[label=\xangle:x] {};
\draw[-latex,blue] (0,-1,0) -- (0,3.5,0) node[label=\yangle:y] {};
%\draw[-latex,black] (0,0,-1) -- (0,0,3.5) node[label=\zangle:z] {};

\foreach \c in {0,...,3}
{   \fill[red] (\c,0,0) circle (0.05cm);
    \fill[blue] (0,\c,0) circle (0.05cm);
%    \fill[black] (0,0,\c) circle (0.05cm);
}
\end{tikzpicture}

\end{document}

It is a modified example from 1.

My question is now, how to assimilate the grid on the new constructed axis. If I use the grid option, the grid is plotted as in a normal cartesian system and is not assimilated to the changed degree.

Your Answer

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

Browse other questions tagged or ask your own question.