Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
Do you mean something like y dir=reverse? –  Jake Jan 11 '13 at 14:54
    
Thanks @jake for your helpful comment. It should be x dir = reverse. I would appreciate if you make your comment as an answer so I can accept it future reference. Thanks –  MYaseen208 Jan 11 '13 at 14:59
    
so did 3D surface in pgfplots with given data get resolved? –  cmhughes Jan 11 '13 at 15:30
    
Yes, @cmhughes. I resolved it. –  MYaseen208 Jan 11 '13 at 15:32
    
ok, thanks for letting us know- will flag to close it as too localized (unless you wish to self-answer it) :) –  cmhughes Jan 11 '13 at 15:33

2 Answers 2

up vote 8 down vote accepted

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.

share|improve this answer

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

share|improve this answer
    
Thanks @jake again for your help. Much appreciated. –  MYaseen208 Jan 11 '13 at 15:03
    
@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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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