6

Here is my code for 3d surface plot with pgfplots.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[
        xlabel = $x$
        , ylabel = $y$
        , zlabel = Test
        , xmin = -1
        , xmax = 1
        , ymin = -1
        , ymax = 1]
   \addplot3
   [
    surf
   ,  faceted color=blue
   , samples  = 15
   , domain   = -1:1
   , y domain = -1:1
   ]
    {776.062 -50.812* x + 153.062 * y -76.812 *x *y};
    \end{axis}
\end{tikzpicture}

\end{document}

enter image description here

I wonder how to get coordinates (x, y) = (-1, -1) rather than (x, y) = (1, -1). Thanks

MYaseen208
  • 8,587

2 Answers2

8

Assuming I understand your question, you want the x-y coordinates to be -1,-1 in the front. You could achieve this with the plot option x dir = reverse. x dir = reverse

or, if you want to keep a right handed coordinate system, you can use the plot optionview={-70}{30}

view={-70}{30}

Reversing the x/y/z direction is rather self explaining.

The option view={azimuth}{elevation} rotates the plot, horizontally and vertically, in degrees. For the rotation, it is important that a negative sign for the rotation implies an inverse view direction.

DennisH
  • 1,667
5

You can reverse the direction of an axis by setting, for example, x dir=reverse:

Jake
  • 232,450
  • @MYaseen208: I think you should accept user24276's answer instead of mine. It's more complete, and therefore more likely to help other people who come across this problem – Jake Jan 11 '13 at 19:14
  • 1
    Okay @jake, I accepted his answer. Anyhow thanks for your help too. – MYaseen208 Jan 11 '13 at 19:19