Graphics, Figures & Tablespst-3dplot | Ticks and Labels on the Axes

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Grasshoper
Posts: 6
Joined: Mon Mar 12, 2012 1:44 pm

pst-3dplot | Ticks and Labels on the Axes

Post by Grasshoper »

Hi there,

I'm using pst-3dplot to plot a 3D mesh between [0,1]. Although the mesh is OK, I could not figure how to get label and ticks on the axes. I tried many options using the package manual but failed.

Here is my (wrong) code:

Code: Select all

\begin{figure}[h]
\begin{center}
\psset{xunit=4cm,yunit=4cm,Alpha=160,Beta=15}
\begin{pspicture}(0,-0.5)(1,1)
\pstThreeDCoor[xMin=0, xMax = 1.2, yMin = 0, yMax = 1.2, zMin = 0, zMax = 1.2, IIIDticks = true, IIIDlabels = true, IIIDticksize = 0.5, linecolor = black, linewidth = 0.02, nameX = $X$, nameY = $Y$, nameZ = $Z$]

%then plot the 3D mesh...

\end{pspicture}
\caption{\label{FigX} blabla.}
\end{center}
\end{figure}
Help would be greatly appreciated.

Grass
Last edited by localghost on Sun Jul 01, 2012 7:06 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pst-3dplot | Ticks and Labels on the Axes

Post by localghost »

For an adequate problem description and in order to avoid guesses and random shots please prepare a minimal example that contains all necessary but only relevant information in form of code.


Best regards and welcome to the board
Thorsten
Grasshoper
Posts: 6
Joined: Mon Mar 12, 2012 1:44 pm

pst-3dplot | Ticks and Labels on the Axes

Post by Grasshoper »

Ok, thanks for the reply.
However, the minimal example is provided in the initial post. All is about the axes, ticks and labels, and not about the mesh. Anyway, here is the full code:

Code: Select all

\begin{figure}[h]
\begin{center}
\psset{xunit=4cm,yunit=4cm,Alpha=160,Beta=15}
\begin{pspicture}(0,-0.5)(1,1)
\pstThreeDCoor[xMin=0, xMax = 1.2, yMin = 0, yMax = 1.2, zMin = 0, zMax = 1.2, IIIDticks = true, IIIDlabels = true, IIIDticksize = 0.5, linecolor = black, linewidth = 0.02, nameX = $X$, nameY = $Y$, nameZ = $Z$]

%grids:
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=yz,linecolor=gray,linewidth=.5pt,linestyle=dashed](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xz,linecolor=gray,linewidth=.5pt,linestyle=dashed](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xy,linecolor=gray,linewidth=.5pt,linestyle=dashed](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=yz,linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=4](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xz,linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=4](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xy,linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=4](0,0)(1,1)

%Plot the Nodes:
\pstThreeDDot[dotscale=1.2](1,0,0)
\pstThreeDDot[dotscale=1.2](0,1,0)
\pstThreeDDot[dotscale=1.2](0,0,1)
\pstThreeDDot[dotscale=1.2](0,0,0)
\pstThreeDDot[dotscale=1.2](1,1,1)
\pstThreeDDot[dotscale=1.2](1,1,0)
\pstThreeDDot[dotscale=1.2](0,1,1)
\pstThreeDDot[dotscale=1.2](1,0,1)
\pstThreeDDot[dotscale=1.2](0.5,0,0)
\pstThreeDDot[dotscale=1.2](0,0.5,0)
\pstThreeDDot[dotscale=1.2](0,0,0.5)
\pstThreeDDot[dotscale=1.2](0.5,0.5,0)
\pstThreeDDot[dotscale=1.2](0,0.5,0.5)
\pstThreeDDot[dotscale=1.2](0.5,0,0.5)
\pstThreeDDot[dotscale=1.2](0.5,1,1)
\pstThreeDDot[dotscale=1.2](1,0.5,1)
\pstThreeDDot[dotscale=1.2](1,1,0.5)
\pstThreeDDot[dotscale=1.2](0.5,0.5,1)
\pstThreeDDot[dotscale=1.2](1,0.5,0.5)
\pstThreeDDot[dotscale=1.2](0.5,1,0.5)
\pstThreeDDot[dotscale=1.2](0.5,1,0)
\pstThreeDDot[dotscale=1.2](1,0.5,0)
\pstThreeDDot[dotscale=1.2](1,0,0.5)
\pstThreeDDot[dotscale=1.2](0.5,0,1)
\pstThreeDDot[dotscale=1.2](0,0.5,1)
\pstThreeDDot[dotscale=1.2](0,1,0.5)

\end{pspicture}
\caption{\label{Fig1} blabla.}
\end{center}
\end{figure}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pst-3dplot | Ticks and Labels on the Axes

Post by localghost »

Grasshoper wrote:[…] However, the minimal example is provided in the initial post. […]
This shows that you didn't follow the respective link in my last reply. And your new code is also not what we understand as a minimal example. I'm not willing to build one on my own just to test possible solutions for you.
Grasshoper
Posts: 6
Joined: Mon Mar 12, 2012 1:44 pm

pst-3dplot | Ticks and Labels on the Axes

Post by Grasshoper »

Thx for the reply.
Both Building up and Hacking down approaches are of great use for any programmer, and I do use both of them intensively (and i do try them before posting here). However, it doesn't help with the current problem:

Code: Select all

\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage{pst-3dplot}

\begin{document}

\begin{figure}[h]
\begin{center}
\psset{xunit=4cm,yunit=4cm,Alpha=160,Beta=15}
\begin{pspicture}(0,-0.5)(1,1)
\pstThreeDCoor[xMin=0, xMax = 1.2, yMin = 0, yMax = 1.2, zMin = 0, zMax = 1.2,
    IIIDticks = true, IIIDlabels = true, IIIDzTicksPlane=yz, IIIDzticksep=-1.2,
    IIIDxTicksPlane=xy, IIIDxticksep=-0.01, IIIDyTicksPlane=yz, IIIDyticksep=0.2, Dx=1.25, Dy=-0.25, Dz=-1.25,
    nameX = $X$, nameY = $Y$, nameZ = $Z$]

%    IIIDticksize = 0.5, linewidth = 0.02,

%grids:
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=yz,linecolor=gray,linewidth=.5pt,linestyle=dashed](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xz,linecolor=gray,linewidth=.5pt,linestyle=dashed](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xy,linecolor=gray,linewidth=.5pt,linestyle=dashed](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=yz,linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=4](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xz,linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=4](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xy,linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=4](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=yz,linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=2](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xz,linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=2](0,0)(1,1)

%Plot the Nodes:
\pstThreeDDot[dotscale=1.2](1,0,0)
\pstThreeDDot[dotscale=1.2](0,1,0)
\pstThreeDDot[dotscale=1.2](0,0,1)
\pstThreeDDot[dotscale=1.2](0,0,0)
\pstThreeDDot[dotscale=1.2](1,1,1)
\pstThreeDDot[dotscale=1.2](1,1,0)
\pstThreeDDot[dotscale=1.2](0,1,1)
\pstThreeDDot[dotscale=1.2](1,0,1)
%Additional nodes:
\pstThreeDDot[dotscale=1.2](0.5,0,0)
\pstThreeDDot[dotscale=1.2](0,0.5,0)
\pstThreeDDot[dotscale=1.2](0,0,0.5)
\pstThreeDDot[dotscale=1.2](0.5,0.5,0)
\pstThreeDDot[dotscale=1.2](0,0.5,0.5)
\pstThreeDDot[dotscale=1.2](0.5,0,0.5)
\pstThreeDDot[dotscale=1.2](0.5,1,1)
\pstThreeDDot[dotscale=1.2](1,0.5,1)
\pstThreeDDot[dotscale=1.2](1,1,0.5)
\pstThreeDDot[dotscale=1.2](0.5,0.5,1)
\pstThreeDDot[dotscale=1.2](1,0.5,0.5)
\pstThreeDDot[dotscale=1.2](0.5,1,0.5)
\pstThreeDDot[dotscale=1.2](0.5,1,0)
\pstThreeDDot[dotscale=1.2](1,0.5,0)
\pstThreeDDot[dotscale=1.2](1,0,0.5)
\pstThreeDDot[dotscale=1.2](0.5,0,1)
\pstThreeDDot[dotscale=1.2](0,0.5,1)
\pstThreeDDot[dotscale=1.2](0,1,0.5)
\pstThreeDDot[dotscale=1.2](0.5,0.5,0.5)

\end{pspicture}
\end{center}
\end{figure}

\end{document}
Regards
Last edited by Stefan Kottwitz on Mon Jul 02, 2012 8:41 am, edited 1 time in total.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

pst-3dplot | Ticks and Labels on the Axes

Post by CrazyHorse »

Grasshoper wrote: Both Building up and Hacking down approaches are of great use for any programmer, and I do use both of them intensively (and i do try them before posting here). However, it doesn't help with the current problem:

Code: Select all

\documentclass[a4paper]{article}
    \usepackage{pst-3dplot}

    \begin{document}
    \psset{unit=4cm,Alpha=160,Beta=15}
    \begin{pspicture}(0,-0.5)(1,1)
    {\pstThreeDCoor[unit=0.8cm,xMin=0, xMax = 5.5, yMin = 0, yMax = 5.5, zMin = 0, zMax = 5.5,
        IIIDticks, IIIDlabels, IIIDzTicksPlane=yz, IIIDzticksep=-1.2,
        IIIDxTicksPlane=xy, IIIDxticksep=-0.05, IIIDyTicksPlane=yz, IIIDyticksep=0.5, 
        nameX = $X$, nameY = $Y$, nameZ = $Z$,Dx=1.25, Dy=-0.25, Dz=-1.25,]}
    %grids:
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=yz,
  linecolor=gray,linewidth=.5pt,linestyle=dashed](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xz,
  linecolor=gray,linewidth=.5pt,linestyle=dashed](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xy,
  linecolor=gray,linewidth=.5pt,linestyle=dashed](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=yz,
  linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=0.5](0,0)(1,1)
\pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xz,
    linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=0.5](0,0)(1,1)
 \pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xy,
   linecolor=gray,linewidth=.5pt,linestyle=dashed,,planeGridOffset=1](0,0)(1,1)
 \pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=yz,
   linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=1](0,0)(1,1)
 \pstThreeDPlaneGrid[xsubticks=2,ysubticks=2,planeGrid=xz,
   linecolor=gray,linewidth=.5pt,linestyle=dashed,planeGridOffset=1](0,0)(1,1)

    %Plot the Nodes:
    \pstThreeDDot[dotscale=1.2](1,0,0)
    \pstThreeDDot[dotscale=1.2](0,1,0)
    \pstThreeDDot[dotscale=1.2](0,0,1)
    \pstThreeDDot[dotscale=1.2](0,0,0)
    \pstThreeDDot[dotscale=1.2](1,1,1)
    \pstThreeDDot[dotscale=1.2](1,1,0)
    \pstThreeDDot[dotscale=1.2](0,1,1)
    \pstThreeDDot[dotscale=1.2](1,0,1)
    %Additional nodes:
    \pstThreeDDot[dotscale=1.2](0.5,0,0)
    \pstThreeDDot[dotscale=1.2](0,0.5,0)
    \pstThreeDDot[dotscale=1.2](0,0,0.5)
    \pstThreeDDot[dotscale=1.2](0.5,0.5,0)
    \pstThreeDDot[dotscale=1.2](0,0.5,0.5)
    \pstThreeDDot[dotscale=1.2](0.5,0,0.5)
    \pstThreeDDot[dotscale=1.2](0.5,1,1)
    \pstThreeDDot[dotscale=1.2](1,0.5,1)
    \pstThreeDDot[dotscale=1.2](1,1,0.5)
    \pstThreeDDot[dotscale=1.2](0.5,0.5,1)
    \pstThreeDDot[dotscale=1.2](1,0.5,0.5)
    \pstThreeDDot[dotscale=1.2](0.5,1,0.5)
    \pstThreeDDot[dotscale=1.2](0.5,1,0)
    \pstThreeDDot[dotscale=1.2](1,0.5,0)
    \pstThreeDDot[dotscale=1.2](1,0,0.5)
    \pstThreeDDot[dotscale=1.2](0.5,0,1)
    \pstThreeDDot[dotscale=1.2](0,0.5,1)
    \pstThreeDDot[dotscale=1.2](0,1,0.5)
    \pstThreeDDot[dotscale=1.2](0.5,0.5,0.5)

    \end{pspicture}

    \end{document}
if you need only the grid, then have a look at package pst-gr3d
Grasshoper
Posts: 6
Joined: Mon Mar 12, 2012 1:44 pm

Re: pst-3dplot | Ticks and Labels on the Axes

Post by Grasshoper »

Thanks for the fast reply.
In fact I need the whole thing: grids, axes and nodes.

Apart the axes label and ticks, the rest is ok.

Could not figure why ticks and label does not appear, event with dx,dy,dz turned on.
Post Reply