Skip to content

Three Dimensional Plots

None

color-markers-3d.gle

color-markers-3d.gle

color-markers-3d.gle
size 12 10

sub draw_colored_markers_3d data$ marker$
   gsave
   set lstyle 1 lwidth 0.06 just center hei 0.3
   fopen data$ file read
   until feof(file)
      fread file x y z red green blue
      set color rgb255(red,green,blue)
      amove xg3d(x,y,0) yg3d(x,y,0)
      circle 0.025 fill rgb255(red,green,blue)
      aline xg3d(x,y,z) yg3d(x,y,z)
      marker marker$ 0.55
      set color black
      rmove 0 0.2
      write format$(z,"fix 2") 
   next
   fclose file
   grestore
end sub

begin object graph
   begin surface
      size 20 10
      cube xlen 20 ylen 20 zlen 10
      xaxis min 0 max 1 dticks 0.2 ticklen 0.09
      yaxis min 0 max 1 dticks 0.2 ticklen 0.09
      zaxis min 0 max 1 dticks 0.2 ticklen 0.09
      xtitle "Title x" hei 0.4
      ytitle "Title y" hei 0.4
      ztitle "Title z" hei 0.4
   end surface
   draw_colored_markers_3d "xyz.csv" ftriangle
end object

amove pagewidth()/2 pageheight()/2
draw graph.cc

fitz.gle

fitz.gle

fitz.gle
size 7 7

set font texcmr

begin fitz
   data "fitz.dat"
   x from 0 to 5 step 0.2
   y from 0 to 5 step 0.2
   ncontour 6
end fitz

begin object fitz
   begin surface
      size 8 8
      data "fitz.z"
      top color blue
      xaxis min 0 max 5 step 1 hei .25
      yaxis min 0 max 5 step 1 hei .25
      zaxis step .5 hei .25
      zaxis min 0 max 2.5
      points "fitz.dat"
      droplines lstyle 1
      marker circle
      view 2.5 3 .3
   end surface
end object

amove pagewidth()/2 pageheight()/2
draw fitz.cc

M16.gle

M16.gle

M16.gle
! Example by Jan Soubusta

size 11 11

mmax = 16   ! size of the matrix

alfa = 25   ! rotation of the cube in horizontal direction
beta = 35   ! rotation of the cube in vertical direction

z_axis_min  = -.5
z_axis_max  = 0.5
persp_scale = 3      ! perspective scale

include "matrix_3D.gle"

z0 = normalize_z(0)  ! origin of z-axis at 0

! compute position of the perspective point of infinity (xgrp, ygrp)
project_3D2D 0.5 0.5 0.5
xgrp = xgr+0; ygrp = ygr-3

begin object graph

   ! draw the graph based on data matrix in "xim03.dat"
   draw_bar_graph_3d "xim03.dat"

   ! draw the axis ticks
   draw_z_ticks z_axis_min z_axis_max .25
   draw_xy_ticks2 5

   ! draw the x-axis tick labels
   label_x 1  "HHHH"
   label_x 6  "HVHV"
   label_x 11 "VHVH"
   label_x 16 "VVVV"

   ! draw the y-axis tick labels
   label_y 1  "HHHH"
   label_y 6  "HVHV"
   label_y 11 "VHVH"
   label_y 16 "VVVV"

end object

! center the graph on the page
amove pagewidth()/2 pageheight()/2
draw graph.cc

M4_Re_Im.gle

M4_Re_Im.gle

M4_Re_Im.gle
! Example by Jan Soubusta

size 21 10.5

alfa = 25
beta = 35
mmax = 4

persp_scale = 3

include "matrix_3D.gle"

sub namaluj_graf jmeno$ skip_lines polabel_xy popisz$
   begin origin
      if (popisz$="re") then
         z_axis_min = -.5
         z_axis_max  =  1
      else
         z_axis_min = -.5
         z_axis_max  = 0.5
         formatz$="fix 2"
      end if
      dmin = z_axis_min
      dmax = z_axis_max
      z0=normalize_z(0)

      draw_back_frame

      fopen jmeno$ vstup read
      local k
      for k=1 to skip_lines
         freadln vstup
      next k
      for k=1 to mmax
         draw_matrix_row k 1
      next k
      fclose vstup

      draw_middle_frame

      if (popisz$="re") then
         draw_z_ticks -.5 1 .5
      else
         draw_z_ticks -.5 .5 .25
      end if

      draw_xy_ticks

      if polabel_xy then
         label_x 1 "HH"
         label_x 2 "HV"
         label_x 3 "VH"
         label_x 4 "VV"

         label_y 1 "HH"
         label_y 2 "HV"
         label_y 3 "VH"
         label_y 4 "VV"
      end if
   end origin
end sub

sub print_xy x y txt$
   amove x y
   write txt$
end sub

!-----------------------------------------------------------

set just cc hei 0.3 color black
x0=0; y0=0
project_3D2D .5 .5 .5
x0 = pagewidth()/2-xgr-4.6
y0 = pageheight()/2-ygr+.8

project_3D2D .5 .5 .5
xgrp = xgr+0
ygrp = ygr-3

!-----------------------------------------------------------

filek$ = "sample_3D.dat"
amove 0 0
namaluj_graf filek$ 1 true "re"

amove 10.5 0
namaluj_graf filek$ 6 true "im"

set just cc hei .6 color black
kam = 8
print_xy 2    kam "Re"
print_xy 12.5 kam "Im"

saddle.gle

saddle.gle

saddle.gle
size 10 9

set font texcmr hei 0.5 just tc

begin letz
   data "saddle.z"
   z = 3/2*(cos(3/5*(y-1))+5/4)/(1+(((x-4)/3)^2))
   x from 0 to 20 step 0.5
   y from 0 to 20 step 0.5
end letz

amove pagewidth()/2 pageheight()-0.1
write "Saddle Plot (3D)"

begin object saddle
   begin surface
      size 10 9
      data "saddle.z"
      xtitle "X-axis" hei 0.35 dist 0.7
      ytitle "Y-axis" hei 0.35 dist 0.7
      ztitle "Z-axis" hei 0.35 dist 0.9
      top color blue
      zaxis ticklen 0.1 min 0 hei 0.25
      xaxis hei 0.25 dticks 4 nolast nofirst
      yaxis hei 0.25 dticks 4
   end surface
end object

amove pagewidth()/2 0.2
draw "saddle.bc"

volcano3d.gle

volcano3d.gle

volcano3d.gle
size 9 9

set font texcmr hei 0.4 just tc
amove pagewidth()/2 pageheight()-0.1
write "Auckland's Maunga Whau Volcano"

begin object volcano
   begin surface
      size 9 9
      data "volcano.z"
      xtitle "X-axis" hei 0.3 dist 0.7
      ytitle "Y-axis" hei 0.3 dist 0.7
      ztitle "Z-axis" hei 0.3 dist 0.9
      top color brown
      zcolour brown
      zaxis ticklen 0.1 hei 0.25
      xaxis hei 0.25 dticks 4 nolast nofirst
      yaxis hei 0.25 dticks 4
   end surface
end object

amove pagewidth()/2 0.4
draw "volcano.bc"