我想要这个坐标系(轴上有数字):
我知道如何在 Tikz 中制作它;但是轴上的数字丢失了,我想添加一个图:
\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}
绘图方程:
((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)
我不知道如何在 x 轴和 y 轴上添加数字。我也不知道如何绘制图表。
亲切的问候!
答案1
对于绘图,使用pgfplots
;其强大的定制功能允许您轻松调整样式为您想要的样式:
代码:
\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}