Plotting a joint distribution function using DAD and the free software GnuPlot

  1. Use DAD and launch the application Distribution => Joint distribution function
  2. Select the appropriate vectors (in this example X: Food expenditures , Y: Non food expenditures)
  3. Click on the button RANGE and choose:
  4.  

  1. Click on the button graph
  2. Choose where you would like to save the ASCII files of the graph coordinates. Such an ASCII fiel will have the appropriate format to be used with GnuPlot to draw the 3D graph.

 

  1. Launch the free package GnuPlot  (v 4.0)
  1. Type the following commands:

 

# To set the Graph title
set title "Joint distribution function: Cameroon 1996"

# To set the X axis title
set xlabel "Food expenditures"

# To set the Y axis title
set ylabel "Non food expenditures"

# To set the z axis title
set zlabel "F(x,y)"

# No hide the legends
# unset key

# To set the tocs level at 0
set ticslevel 0

# To plot the 3D graph
splot "c:/data_graphs/graph2.dat" using 1:2:3 with lines 1

 

  1. Other proposed commands

# To set the Graph title
set title "Joint distribution function: Cameroon 1996"

# To set the X axis title
set xlabel "Food expenditures"

# To set the Y axis title
set ylabel "Non food expenditures"

# To set the z axis title
set zlabel "F(x,y)"

# No hide the legends
# unset key

# To set the tocs level at 0
set ticslevel 0

# to set the view parameters
set view (50,312)

# to hide lines
set hidden3d

#drawing with palette-mapped
set pm3d

# To plot the 3D graph
splot "c:/data_graphs/graph2.dat" using 1:2:3 with lines 1
 

Remarks :
  • You can change some options for the plotted graph. For this, click on the left button of the mouse when the cursor is on the top panel and select the item Options.
  • You can also rotate the graph by pressing the right button of the mouse and at the same time moving the cursor in the desired direction.