LaTex Plot Axis 3D

There are many packages in LaTeX to plot 3D, including tikz-3dplot, and other exotic packages.

The easiest one to use for plotting a simple 3D graph, with xyz axis and origin, is Pgfplots in my opinion.

The code to plot the diagram below is included for reference.

First, we need to add the following in the preamble of the LaTeX document:


Then, to draw the actual diagram, the following simple code will do:

  axis lines=center,

% plot dots for the points
\addplot3 [only marks] coordinates {(1,2,3) (4,5,6)};

% plot dashed lines to axes
\addplot3 [no marks,densely dashed] coordinates {(1,2,3) (4,5,6)};

% label points
\node [above] at (axis cs:1,2,3) {$A (1,2,3)$};
\node [above right] at (axis cs:4,5,6) {$B (4,5,6)$};
\node [below left] at (axis cs:0,0,0) {$O$};

LaTeX Horizontal Flowchart (Workflow)


Just found an excellent source on how to draw a simple (slightly fanciful) horizontal flowchart using LaTeX (TikZ).

The output is very neat:

The code is reproduced here (in case the original source gets deleted):

\documentclass[tikz, margin=3mm]{standalone}
% for fancy looks of data storages
    node distance = 5mm and 7mm,
      start chain = going right,
 disc/.style = {shape=cylinder, draw, shape aspect=0.3,
                shape border rotate=90,
                text width=17mm, align=center, font=\linespread{0.8}\selectfont},
  mdl/.style = {shape=ellipse, aspect=2.2, draw},
  alg/.style = {draw, align=center, font=\linespread{0.8}\selectfont}
    \begin{scope}[every node/.append style={on chain, join=by -Stealth}]
\node (n1) [disc] {Training\\ data};
\node (n2) [alg]  {Learning\\ algorithm};
\node (n3) [mdl]  {Model};
\node (n4) [disc] {Test\\ data};
\node (n3) [mdl]  {Accuracy};
\node[below=of n2]  {Step 1: Training};
\node[below=of n4]  {Step 2: Tresting};

Multiline Flow Chart

For flowcharts that exceed one line (and hence require a line break), the following Tikz code is very helpful! (Source:

        \tikzset{block/.style= {draw, rectangle, align=center,minimum width=2cm,minimum height=1cm},
        rblock/.style={draw, shape=rectangle,rounded corners=1.5em,align=center,minimum width=2cm,minimum height=1cm},
        input/.style={ % requires library shapes.geometric
        trapezium left angle=60,
        trapezium right angle=120,
        minimum width=2cm,
        minimum height=1cm
        \node [rblock]  (start) {Start};
        \node [block, right =2cm of start] (acquire) {Acquire Image};
        \node [block, right =2cm of acquire] (rgb2gray) {RGB to Gray};
        \node [block, right =2cm of rgb2gray] (otsu) {Localized OTSU \\ Thresholding};
        \node [block, below right =2cm and -0.5cm of start] (gchannel) {Subtract the \\ Green Channel};
        \node [block, right =2cm of gchannel] (closing) {Morphological \\ Closing};
        \node [block, right =2cm of closing] (NN) {Sign Detection \\ Using NN};
        \node [input, right =2cm of NN] (limit) {Speed \\ Limit};
        \node [coordinate, below right =1cm and 1cm of otsu] (right) {};  %% Coordinate on right and middle
        \node [coordinate,above left =1cm and 1cm of gchannel] (left) {};  %% Coordinate on left and middle

%% paths
        \path[draw,->] (start) edge (acquire)
                    (acquire) edge (rgb2gray)
                    (rgb2gray) edge (otsu)
                    (otsu.east) -| (right) -- (left) |- (gchannel)
                    (gchannel) edge (closing)
                    (closing) edge (NN)
                    (NN) edge (limit)


Interactive Astronomy using 3D Computer Graphics

This is a school project on using 3D Computer Graphics. It explores a phenomenon whereby a sundial can actually go backwards in the tropics!


Understanding spherical astronomy requires good spatial visualization. Unfortunately, it is very hard to make good three dimensional (3D) illustrations and many illustrations from standard textbooks are in fact incorrect. There are many programs that can be used to create illustrations, but in this report we have focused on TEX-friendly, free programs. We have compared MetaPost, PSTricks, Asymptote and Sketch by creating a series of illustrations related to the problem of why sundials sometimes go backwards in the tropics.


In it, the Hezekiah Phenomenon is being discussed.

Quote: First, we would like to explain where the name Hezekiah Phenomenon comes from. In the Bible there is a story about God making the shadow of the sundial move backward as a sign for King Hezekiah.

The Bible gives two versions of the story of King Hezekiah and the sundial. First in 2 Kings, Chapter 20.

8 And Hezekiah said unto Isaiah, What [shall be] the sign that the LORD will heal me, and that I shall go up into the house of the LORD the third day? 9 And Isaiah said, This sign shalt thou have of the LORD, that the LORD will do the thing that he hath spoken: shall the shadow go forward ten degrees, or go back ten degrees? 10 And Hezekiah answered, It is a light thing for the shadow to go down ten degrees: nay, but let the shadow return backward ten degrees. 11 And Isaiah the prophet cried unto the LORD: and he brought the shadow ten degrees backward, by which it had gone down in the dial of Ahaz. (2 Kings 20: 8–11, King James Version)