2016-11-28 2 views
1

Ich möchte ein 3D - Oberflächendiagramm kombiniert mit Heatmap - Plot der gleichen Funktion (von file Daten) unten darstellen (wie im Kapitel "Oberflächen kombinieren mit Bilder "in Gnuplot Cookbook). Das gewünschte Bild sieht wie this und this aus.Gnuplot Oberflächendiagramm kombiniert mit Heatmap auf der gleichen Parzelle in Polarkoordinaten

Das Konturdiagramm wird mit der script gezeichnet.

Ist es möglich, zwei Grafiken (Kontur und 3D) in den Polarkoordinaten in einem Diagramm über Gnuplot zu zeichnen?

Ausgang ist nichts, so gibt es einen Fehler im Code:

reset 
set terminal pngcairo size 800,800 enhanced font 'Verdana,20' 
set output '3d-polar_AbsPsiSquared.png' 

set lmargin at screen 0.05 
set rmargin at screen 0.85 
set bmargin at screen 0.1 
set tmargin at screen 0.9 

set pm3d 
unset key 
set multiplot 

stats '_FullWV.dat' using ($3*$3+$4*$4) 
max(a,b) = (a>b) ? a : b 
round2(x) = x - floor(x) < 0.5 ? floor(x) : ceil(x) 
round(x, n) = round2(x*10**n)*10.0**(-n) 

Z_MAX = max(-STATS_min, STATS_max) 
Z_MAX = round(Z_MAX,1) 

set parametric 
set grid xtics ytics 
set angles degree 

#set zrange[-1,1] 
#set cbrange [-1:1] 
set autoscale fix 
#set autoscale xfix 
#set autoscale yfix 
set autoscale zfix 
#set autoscale 
set cbrange [-Z_MAX : Z_MAX] 

set palette model RGB defined (0"#6495ED", 1"blue", 2"#00008B",3"white",\ 
    4"green",5"yellow",6"red") 
#splot '_FullWV.dat' u ($2*cos($1)):($2*sin($1)):($3*$3+$4*$4) 
set size ratio -1 
set hidden front 
set xyplane at -1 
splot '_FullWV.dat' u (abs(($3*$3+$4*$4))<1e-3 ? NaN : $2*cos($1)):($2*sin($1)):($3*$3+$4*$4) with pm3d at b, '_FullWV.dat' u (abs(($3*$3+$4*$4))<1e-3 ? NaN : $2*cos($1)):($2*sin($1)):($3*$3+$4*$4) with pm3d 

unset multiplot 
+0

Was haben Sie versucht, ? –

+0

@EricDuminil: die Frage aktualisiert - Ich habe gerade versucht, das vorhandene Skript zu ändern, um das Oberflächenplot hinzuzufügen, aber die Ausgabe wird nicht erzeugt (obwohl Gnuplot keine Fehlermeldungen anzeigt) –

+0

Ist es ein anderes ' _FullWV.dat' Datei als für die anderen Fragen? Es gibt nur 3 Spalten, und Sie verweisen auf einen vierten mit $ 4. –

Antwort

0

scheint, die Lösung depthorder Möglichkeit pm3d ist, so das richtige Skript ist:

reset 
set terminal postscript eps size 5,6 enhanced color font 'Helvetica,20' linewidth 2 
set output "3d.eps" 

set tics scale 1.25 

set xlabel '{/Helvetica-Oblique x, a.u.}' 
set ylabel '{/Helvetica-Oblique y, a.u.}' 
set zlabel '{/Helvetica-Oblique E, a.u.}' 

set pm3d depthorder 
unset key 
set multiplot 
unset colorbox 

stats '_FullWV.dat' using ($3*$3+$4*$4) 
max(a,b) = (a>b) ? a : b 
round2(x) = x - floor(x) < 0.5 ? floor(x) : ceil(x) 
round(x, n) = round2(x*10**n)*10.0**(-n) 

Z_MAX = max(-STATS_min, STATS_max) 
Z_MAX = round(Z_MAX,1) 

set parametric 
set grid xtics ytics ztics 
set mxtics 2 
set mytics 2 
set tics out 
set decimalsign "," 

set format x "%.1f" 
set format y "%.1f" 
set format z "%.0f" 

set angles degree 
set view 61,33 
set ztics floor(Z_MAX/3) 


set autoscale fix 
set autoscale zfix 
set cbrange [0 : Z_MAX] 



set palette model RGB defined (0"#168de2", 1"#0201db", 2"#00008B", 3"#00dcf5",\ 
     4"#09df67",5"yellow",6"red") 
set size ratio 1 
set hidden3d front 
set xyplane at -10 
splot '_FullWV.dat' u (abs(($3*$3+$4*$4))<1e-3 ? NaN : $2*cos($1)):($2*sin($1)):($3*$3+$4*$4) with pm3d at b, '_FullWV.dat' u (abs(($3*$3+$4*$4))<1e-3 ? NaN : $2*cos($1)):($2*sin($1)):($3*$3+$4*$4) with pm3d 

unset multiplot 
Verwandte Themen