This is a follow-up question to this
I have plotted the graph with online help of different resources (code and picture attached)
Now the problems are:
It is not correcting plotting the curve in the y-z plane the red line and give this error message
Package pgfplots Error: Sorry, you can't use 'y' in this context. PGFPlots are expected to sample a line, not a mesh. Please use the [mesh]
option combined with [samples y>0]
and [domain y!=0:0]
to indicate a twodimensional input domain.
Labels are too small and not placed properly.
If somebody can set view angles so it looks like the original picture of the book (Picture attached).
If somebody can help in that regard.
RAR
\documentclass[border=1cm]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc,math}
\pgfplotsset{compat=newest}
\pgfkeys{/pgf/declare function={H(\x,\y) = 3*((((((\x)^2-(\y)^2+3*(\x)+2)^2+((2*\x*\y)+3*\y)^2)+2.2204e-16)^(1/2))/(((((\x)^3+5*(\x)^2-3*\x*(\y)^2+8*x-5*(\y)^2+6)^2+(3*(\x)^2*y+10*\x*\y-(\y)^3+8*y)^2)+2.2204e-16)^(1/2)));}}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle, axis on top,
axis equal image,
width=50cm,
view={30}{10},
xmin=-4,
xmax=0,
ymin=-2,
ymax=2,
zmin=0,
zmax=5,
miter limit=1,
xlabel=$\sigma$,
xlabel style={anchor=east,xshift=-5pt,at={(xticklabel* cs:.95)}},
ylabel=$j\Omega$,
zlabel=$\mathopen| H(s)\mathclose|$,
zlabel style={anchor=north east},
xtick = {-3,-2,-1,0},
hide obscured x ticks=false,
ytick = {-1,0,1},
ztick = {2,4},
]
\addplot3[
smooth,
surf,
faceted color=gray,
line width=0.1pt,
fill=white,
domain=-4:0,
y domain = -2:2,
samples = 50,
samples y = 50,
restrict z to domain*=0:5]
{H(\x,\y)};
\addplot3[domain=-2:2,samples=70, samples y = 0,red, thick] ({0},{x},{H(0,x)});
\end{axis}
\end{tikzpicture}
\end{document}
I have completed everything but just one thing left. I am not able to draw the curve of function in YZ plane where X=0. I cannot understand why this line
\addplot3[domain=-2:2,samples=70, samples y = 0,red, thick] ({0},{x},{H(0,x)});
giving this error
Package pgfplots Error: Sorry, you can't use 'y' in this context. PGFPlots expected to sample a line, not a mesh. Please use the [mesh] option combined with [samples y>0] and [domain y!=0:0] to indicate a twodimensional input domain.
I have searched all websites everybody syntax is working.
Basically it should follow the curve in YZ plane of H(x,y) where x=0.
if somebody can throw some light.
\documentclass[border=1cm]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc,math}
\pgfplotsset{compat=newest}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{arrows}
\pgfplotsset{every tick label/.append style={font=\huge}}
\pgfkeys{/pgf/declare function={H(\x,\y) = 3*((((((\x)^2-(\y)^2+3*(\x)+2)^2+((2*\x*\y)+3*\y)^2)+2.2204e-16)^(1/2))/(((((\x)^3+5*(\x)^2-3*\x*(\y)^2+8*x-5*(\y)^2+6)^2+(3*(\x)^2*y+10*\x*\y-(\y)^3+8*y)^2)+2.2204e-16)^(1/2)));}}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle, axis on top,
axis equal image,
axis line style={black, ultra thick},
width=50cm,
view={30}{15},
xmin=-4,
xmax=0,
ymin=-2,
ymax=2,
zmin=0,
zmax=5,
miter limit=1,
xlabel=$\sigma$,
xlabel style={font=\Huge, anchor=east,xshift=1pt,at={(xticklabel* cs:1.05)}},
ylabel style={font=\Huge, anchor=west},
ylabel=$j\Omega$,
zlabel=$\mathopen| H(s)\mathclose|$,
zlabel style={font=\Huge, anchor=north west},
xtick = {-3,-2,-1,0},
hide obscured x ticks=false,
ytick = {-1,0,1},
ztick = {2,4},
]
\addplot3[
smooth,
surf,
faceted color=gray,
line width=0.1pt,
fill=white,
domain=-4:0,
y domain = -2:2,
samples = 50,
samples y = 50,
restrict z to domain*=0:5]
{H(\x,\y)};
\addplot3[ultra thick, dotted,black] coordinates {
(0,1,0)
(-1,1,0)
(-1,0,0)
};
\addplot3[ultra thick, dotted,black] coordinates {
(-1,1,0)
(-1,1,5)
};
\addplot3[ultra thick, dotted,black] coordinates {
(0,-1,0)
(-1,-1,0)
(-1,0,0)
} ;
\addplot3[ultra thick, dotted,black] coordinates {
(-1,-1,0)
(-1,-1,5)
};
\addplot3[ultra thick, dotted,black] coordinates {
(-3,0,0)
(-3,0,5)
};
\addplot3[black] coordinates {(-1,1,0)} node[solid, cross out,draw=black,] {};
\addplot3[black] coordinates {(-1,-1,0)} node[solid, cross out,draw=black] {};
\addplot3[black] coordinates {(-3,0,0)} node[solid, cross out,draw=black] {};
\draw[black, thin,fill=white] (-1,0,0) circle [radius=0.03];
\draw[black, thin,fill=white] (-2,0,0) circle [radius=0.03];
\addplot3[domain=-2:2,samples=70, samples y = 0,red, thick] ({0},{x},{H(0,x)});
\end{axis}
\end{tikzpicture}
\end{document}
samples y
to 0. You won't get any points. What is your expected output for the red function?