1

I got the following figure:

enter image description here

with this code:

\documentclass{standalone}
\usepackage{pgfplots}

\begin{document}

\def\centerx{2}
\def\centery{-1}
\begin{tikzpicture}
    \begin{axis}
    \addplot3[surf,domain=-2:6,domain y=-5:3] 
        {exp(-( (x-\centerx)^2 + (y-\centery)^2)/3 )};
    \node[circle,inner sep=1pt,fill=blue,pin=90:$\mu$] 
        at (axis cs:\centerx,\centery,1) {};
    \end{axis}
\end{tikzpicture}
\end{document}

I wonder how to get this figure without some axes as below:

enter image description here

2

You probably want to use the axis lines options (see section 4.9.9 of the pgfplots manual).

\documentclass{standalone}
\usepackage{pgfplots}

\begin{document}

\def\centerx{2}
\def\centery{-1}
\begin{tikzpicture}
    \begin{axis}[axis lines=left]
    \addplot3[surf,domain=-2:6,domain y=-5:3] 
        {exp(-( (x-\centerx)^2 + (y-\centery)^2)/3 )};
    \node[circle,inner sep=1pt,fill=blue,pin=90:$\mu$] 
        at (axis cs:\centerx,\centery,1) {};
    \end{axis}
\end{tikzpicture}
\end{document}

Bivariate plot with only left axis lines

2
  • Thanks @hugovdberg for your answer. If you have noticed it the pfd has value greater than 1 which is not possible. Have you any idea? Please also include figure in your answer. Thanks – MYaseen208 Feb 25 '14 at 17:12
  • I added a picture to my original answer. The maximum value does not exceed 1, it only looks like it does because of the angle at which you see the picture. This optical illusion is just an artefact of your request. You could add the option view={0}{0} to the axis options to move the camera such that you look straight to the side, and you will see it is perfectly fine. – hugovdberg Feb 25 '14 at 17:23

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.