4

I would like to have this coordinate system (with numbers on the axes):

Coordinate System

I know how to make it in Tikz; but the numbers on the axes are missing and I would like to add a plot:

\documentclass[border=10pt, tikz]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{arrows,positioning} 

\begin{document}
\tikzset{
>=stealth',
punkt/.style={
           rectangle,
           rounded corners,
           draw=black, very thick,
           text width=6.5em,
           minimum height=2em,
           text centered},
pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt,}
}
\begin{tikzpicture}
\draw [pil] (4,0) -- (4,8);
\draw [pil] (0,4) -- (8,4);
\draw [gray, dashed, very thin] (0,0) grid (8,8);
\end{tikzpicture}


\end{document}

The equation of the plot:

((x/7)^2*sqrt(abs(abs(x)-3)/(abs(x)-3))+(y/3)^2*sqrt(abs(y+3/7*sqrt(33))/(y+3/7*sqrt(33)))-1)

I don't know how to add numbers on the x- and y-axis. And I don't know how to plot the graph.

Kind regards!

3
  • 1
    pgfplots would be a better choice here. Would you be willing to switch? Jul 2, 2015 at 23:58
  • @GonzaloMedina I would, if I could. But I don't know how to make a coordinate system like the above. The coordinate systems in the Manual don't look the coordinate system I've made. :-) Jul 3, 2015 at 0:31
  • Does the equation have two independent variables x and y? Should not a two-variable function be plotted in a three-dimensional coordinate system?
    – enthu
    Jul 3, 2015 at 8:20

1 Answer 1

5

For plots, use pgfplots; its great customization capabilities allow to easily adapt the style to the one you want:

enter image description here

The code:

\documentclass[border=10pt, tikz]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{arrows} 

\tikzset{
>=stealth',
punkt/.style={
           rectangle,
           rounded corners,
           draw=black, very thick,
           text width=6.5em,
           minimum height=2em,
           text centered},
pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt,}
}

\pgfplotsset{
  grid style={gray, dashed, very thin},
  every inner x axis line/.append style={pil},
  every inner y axis line/.append style={pil},
}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
  axis lines=middle,
  grid=major,
  xmin=-4,
  xmax=4,
  ymin=-4,
  ymax=4,
  xtick={-4,-3,...,4},
  ytick={-4,-3,...,4},
  width=12cm,
  height=12cm,
]
\addplot+[mark=none] function[raw gnuplot] {
      set contour base;
      set cntrparam levels discrete 0.0;
      unset surface;
      set view map;
      set isosamples 500;
      splot ((x/7)^2*sqrt(abs(abs(x)-3)/(abs(x)-3))+(y/3)^2*sqrt(abs(y+3/7*sqrt(33))/(y+3/7*sqrt(33)))-1);
    };
\end{axis}
\end{tikzpicture}

\end{document}
1
  • @BasiliusSapientia You're welcome! Jul 3, 2015 at 1:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .