1

I have the following graph where I'm trying to scale the display of the result for the axis labeled "Pressure." I would like the result to show "2,000" instead of "2".

image

MWE below:

\documentclass[letterpage,12pt]{article}

\usepackage{pgfplots}
\pgfplotsset{colormap={grays}{gray(0cm)=(0.5);gray(1cm)=(0)}}
\pgfplotsset{compat=1.13}

\begin{document}

\begin{figure}
    \begin{center}
        \begin{tikzpicture}
            \begin{axis}[%
                view={60}{30},
                axis equal image,
                width=\textwidth,
                xlabel style={align=center},
                xlabel={Pressure \\ $q_v$},
                ylabel={$y$},
                zlabel={$z$}
                ]
                \addplot3[
                patch,
                fill=white,
                opacity=0.8,
                samples=51,
                domain=-3:3,
                y domain=0:-3,
                point meta=x
                ]
                ({-3*5*5^2*y/(2*3.1415*(1.5^2+x^2+y^2)^2.5)}, x, y);
            \end{axis}
        \end{tikzpicture}
    \end{center}
\end{figure}

\end{document}
  • Just add xtick={0,2},xticklabels={$0$,{$2,000$}}, to the options of your axis. – user121799 Apr 11 at 18:26
  • 1
    @marmot, suppose that these values could change, I would be looking for a solution where they would update automatically. – grfrazee Apr 11 at 18:32
2

OK, how about

\documentclass[letterpage,12pt]{article}

\usepackage{pgfplots}
\pgfplotsset{colormap={grays}{gray(0cm)=(0.5);gray(1cm)=(0)}}
\pgfplotsset{compat=1.13}

\begin{document}

\begin{figure}
    \begin{center}
        \begin{tikzpicture}
            \begin{axis}[%
                view={60}{30},
                axis equal image,
                width=\textwidth,
                xlabel style={align=center},
                xlabel={Pressure \\ $q_v$},
                ylabel={$y$},
                zlabel={$z$},
                %xtick={0,2},
                xticklabel={\pgfmathparse{1000*\tick}$\pgfmathprintnumber{\pgfmathresult}$},
                ]
                \addplot3[
                patch,
                fill=white,
                opacity=0.8,
                samples=51,
                domain=-3:3,
                y domain=0:-3,
                point meta=x
                ]
                ({-3*5*5^2*y/(2*3.1415*(1.5^2+x^2+y^2)^2.5)}, x, y);
            \end{axis}
        \end{tikzpicture}
    \end{center}
\end{figure}

\end{document}

then?

enter image description here

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.