FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

New demo showing nonlinear transform of both x and y axes jointly. · gnuplot/gnuplot@6002b49 · GitHub

Repository navigation

Commit 6002b49

Browse files
Ethan A Merritt
committed
New demo showing nonlinear transform of both x and y axes jointly.
Map projections using [longitude ; latitude] -> [x, y] Note: We lack a mechanism to provide inverse transforms for mouse readout.
1 parent dc265e5 commit 6002b49

9 files changed

Lines changed: 100 additions & 41 deletions

File tree

‎demo/html/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ GNUPLOT_LIB = ..
1212
# Several of the demos need manual intervention:
1313
# fontfile vector epslatex
1414
#
15-
html: airfoil.html approximate.html armillary.html array.html arrowstyle.html barchart_art.html binary.html bins.html bivariat.html boxplot.html boxclusters.html candlesticks.html cerf.html circles.html cities.html complex_trig.html columnhead.html contours.html custom_contours.html controls.html custom_key.html dashtypes.html datastrings.html dgrid3d.html discrete.html electron.html ellipse.html enhanced_utf8.html epslatex.html errorbars.html fenceplot.html fillbetween.html fillcrvs.html fillstyle.html finance.html fit.html hidden.html hidden2.html histograms.html histograms2.html gantt.html image.html image2.html index.html iterate.html jitter.html label_stacked_histograms.html layout.html lines_arrows.html linkedaxes.html margins.html monotonic_spline.html multiaxis.html multimsh.html multiplt.html nokey.html nonlinear1.html nonlinear3.html parallel.html param.html piecewise.html pm3dcolors.html pm3d.html pm3dgamma.html pm3d_lighting.html pointsize.html polar.html poldat.html prob2.html prob.html rainbow.html random.html rectangle.html rgba_lines.html rgbalpha.html rgb_variable.html rotate_labels.html rugplot.html running_avg.html sampling.html scatter.html simple.html singulr.html smooth.html solar_path.html spline.html smooth_splines.html steps.html stringvar.html surface1.html surface2.html azimuth.html transparent.html transparent_solids.html textbox.html tics.html timedat.html ttics.html using.html varcolor.html vector.html violinplot.html walls.html world.html world2.html animate2.html heatmaps.html stats.html zerror.html
15+
html: airfoil.html approximate.html armillary.html array.html arrowstyle.html barchart_art.html binary.html bins.html bivariat.html boxplot.html boxclusters.html candlesticks.html cerf.html circles.html cities.html complex_trig.html columnhead.html contours.html custom_contours.html controls.html custom_key.html dashtypes.html datastrings.html dgrid3d.html discrete.html electron.html ellipse.html enhanced_utf8.html epslatex.html errorbars.html fenceplot.html fillbetween.html fillcrvs.html fillstyle.html finance.html fit.html hidden.html hidden2.html histograms.html histograms2.html gantt.html image.html image2.html index.html iterate.html jitter.html label_stacked_histograms.html layout.html lines_arrows.html linkedaxes.html map_projection.html margins.html monotonic_spline.html multiaxis.html multimsh.html multiplt.html nokey.html nonlinear1.html nonlinear3.html parallel.html param.html piecewise.html pm3dcolors.html pm3d.html pm3dgamma.html pm3d_lighting.html pointsize.html polar.html poldat.html prob2.html prob.html rainbow.html random.html rectangle.html rgba_lines.html rgbalpha.html rgb_variable.html rotate_labels.html rugplot.html running_avg.html sampling.html scatter.html simple.html singulr.html smooth.html solar_path.html spline.html smooth_splines.html steps.html stringvar.html surface1.html surface2.html azimuth.html transparent.html transparent_solids.html textbox.html tics.html timedat.html ttics.html using.html varcolor.html vector.html violinplot.html walls.html world.html world2.html animate2.html heatmaps.html stats.html zerror.html
1616

1717
index.html: index.save
1818
cp index.save index.html

‎demo/html/Makefile.canvas‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GNUPLOT_LIB = ..
1111
#
1212
html_3d: binary.html bivariat.html contours.html custom_contours.html datastrings.html discrete.html errorbars.html fenceplot.html hidden.html hidden2.html margins.html multimsh.html pm3dcolors.html pm3d.html pm3d_lighting.html pointsize.html random.html rgb_variable.html sampling.html scatter.html singulr.html surface1.html surface2.html azimuth.html transparent_solids.html vector.html walls.html world.html world2.html zerror.html
1313

14-
html_2d: airfoil.html approximate.html array.html barchart_art.html bins.html boxplot.html boxclusters.html candlesticks.html canvas_utf8.html circles.html cities.html columnhead.html controls.html custom_key.html dashtypes.html electron.html enhanced_utf8.html fillbetween.html fillcrvs.html fillstyle.html finance.html histograms.html histograms2.html hypertext.html gantt.html index.html iterate.html jitter.html label_stacked_histograms.html layout.html lines_arrows.html linkedaxes.html monotonic_spline.html multiaxis.html multiplt.html nonlinear1.html nonlinear3.html nokey.html param.html piecewise.html polar.html poldat.html prob2.html prob.html rainbow.html ellipse.html rectangle.html rgba_lines.html rgbalpha.html rotate_labels.html rugplot.html running_avg.html simple.html smooth.html solar_path.html smooth_splines.html spline.html steps.html transparent.html timedat.html ttics.html using.html varcolor.html world.html heatmaps.html stats.html violinplot.html
14+
html_2d: airfoil.html approximate.html array.html barchart_art.html bins.html boxplot.html boxclusters.html candlesticks.html canvas_utf8.html circles.html cities.html columnhead.html controls.html custom_key.html dashtypes.html electron.html enhanced_utf8.html fillbetween.html fillcrvs.html fillstyle.html finance.html histograms.html histograms2.html hypertext.html gantt.html index.html iterate.html jitter.html label_stacked_histograms.html layout.html lines_arrows.html linkedaxes.html map_projection.html monotonic_spline.html multiaxis.html multiplt.html nonlinear1.html nonlinear3.html nokey.html param.html piecewise.html polar.html poldat.html prob2.html prob.html rainbow.html ellipse.html rectangle.html rgba_lines.html rgbalpha.html rotate_labels.html rugplot.html running_avg.html simple.html smooth.html solar_path.html smooth_splines.html spline.html steps.html transparent.html timedat.html ttics.html using.html varcolor.html world.html heatmaps.html stats.html violinplot.html
1515

1616
html: html_2d html_3d
1717

‎demo/html/Makefile.svg‎

Lines changed: 1 addition & 1 deletion
LoadingViewer requires iframe.

‎demo/html/index.canvas‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
<li><a href="label_stacked_histograms.html">label stacked histogram</a></li>
131131
<li><a href="heatmaps.html">2D and 3D heat maps</a></li>
132132
<li><a href="solar_path.html">solar path diagram</a></li>
133+
<li><a href="map_projection.html">map projections</a></li>
133134
<li><a href="violinplot.html">violin plot</a></li>
134135
</ul>
135136

‎demo/html/index.save‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Here are samples of PNG output from some of the demos.
138138
<li><a href="label_stacked_histograms.html">label stacked histogram</a></li>
139139
<li><a href="heatmaps.html">2D and 3D heat maps</a></li>
140140
<li><a href="solar_path.html">solar path diagram</a></li>
141+
<li><a href="map_projection.html">map projections</a></li>
141142
<li><a href="violinplot.html">violin plot</a></li>
142143
</ul>
143144

‎demo/html/index.svg‎

Lines changed: 1 addition & 0 deletions
LoadingViewer requires iframe.

‎demo/map_projection.dem‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Map projections are nonlinear transforms (λ,φ) -> (x,y)
2+
# where λ = longitude φ = latitude
3+
4+
# "Winkel tripel" map projection (Oswald Winkel 1874-1953)
5+
# This is the arithmetic mean of an equirectangular projection and the
6+
# Aitoff projection.
7+
# Note: mouse tracking does *not* report longitude, latitude
8+
9+
set title "'{/:Bold Winkel tripel}' map projection"
10+
11+
π = pi
12+
φ1 = acos(2./π)
13+
sinc(x) = (x==0) ? 1.0 : sin(x) / x
14+
α(λ,φ) = acos(cos(φ) * cos(λ/2.))
15+
x_W3(λ, φ) = 0.5 * (λ*cos(φ1) + (2*cos(φ)*sin(λ/2.))/sinc(α(λ,φ)))
16+
y_W3(λ, φ) = 0.5 * (φ + sin(φ)/sinc(α(λ,φ)))
17+
18+
set key top right at screen 0.98, 0.95 samplen 0.3
19+
set angle degrees
20+
unset xtics
21+
unset ytics
22+
unset border
23+
set lmargin 1
24+
set rmargin 1
25+
set size ratio 0.5
26+
27+
set xrange [-180:180]
28+
set yrange [-90:90]
29+
30+
plot for [λ=-180:180:10] [φ=-90:90] '+' using (x_W3(λ,φ)):(y_W3(λ,φ)) with lines lc "cyan" lw .5 notitle, \
31+
for [φ = -90:90:30] [λ=-180:180:10] '+' using (x_W3(λ,φ)):(y_W3(λ,φ)) with lines lc "cyan" lw .5 notitle, \
32+
'world.dat' using (x_W3($1,$2)):(y_W3($1,$2)) with filledcurve fc "brown" title "fill", \
33+
'world.dat' using (x_W3($1,$2)):(y_W3($1,$2)) with lines lc "black" title "outline"
34+
35+
pause -1 "<cr> to continue"
36+
37+
38+
# Hammer equal-area projection (Ernst Hammer 1892)
39+
# Note: mouse tracking does *not* report longitude, latitude
40+
41+
set title "{/:Bold Hammer} equal-area map projection"
42+
43+
x_Hammer(λ, φ) = (2*sqrt(2)*cos(φ)*sin(λ/2)) / sqrt(1.0 + cos(φ)*cos(λ/2))
44+
y_Hammer(λ, φ) = sqrt(2)*sin(φ) / sqrt(1.0 + cos(φ)*cos(λ/2))
45+
46+
set xrange [-π : π]
47+
set yrange [-π/2 : π/2]
48+
49+
plot for [λ=-180:180:10] [φ=-90:90] '+' using (x_Hammer(λ,φ)):(y_Hammer(λ,φ)) with lines lc "cyan" lw .5 notitle, \
50+
for [φ = -90:90:30] [λ=-180:180:10] '+' using (x_Hammer(λ,φ)):(y_Hammer(λ,φ)) with lines lc "cyan" lw .5 notitle, \
51+
'world.dat' using (x_Hammer($1,$2)):(y_Hammer($1,$2)) with filledcurve fc "brown" title "fill", \
52+
'world.dat' using (x_Hammer($1,$2)):(y_Hammer($1,$2)) with lines lc "black" title "outline"
53+
54+
pause -1 "<cr> to continue"
55+
56+
reset

‎demo/world.dat‎

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,40 +1164,6 @@
11641164
141.44 73.88
11651165
141.48 73.84
11661166

1167-
0.01 -71.68
1168-
6.57 -70.57
1169-
15.04 -70.44
1170-
25.10 -70.75
1171-
33.37 -69.10
1172-
38.46 -69.77
1173-
42.85 -68.16
1174-
46.59 -67.23
1175-
49.35 -66.96
1176-
52.90 -65.97
1177-
58.46 -67.20
1178-
63.60 -67.58
1179-
70.63 -68.41
1180-
69.24 -70.36
1181-
76.20 -69.44
1182-
88.08 -66.64
1183-
94.98 -66.52
1184-
101.53 -66.09
1185-
111.31 -65.91
1186-
118.64 -66.87
1187-
126.24 -66.24
1188-
133.09 -66.18
1189-
139.85 -66.72
1190-
146.86 -67.96
1191-
153.65 -68.82
1192-
159.94 -69.57
1193-
164.10 -70.67
1194-
170.19 -71.94
1195-
165.68 -74.64
1196-
163.82 -77.60
1197-
162.10 -78.95
1198-
166.72 -82.84
1199-
175.58 -83.86
1200-
12011167
-178.56 -84.37
12021168
-147.96 -85.40
12031169
-152.96 -81.12
@@ -1247,6 +1213,39 @@
12471213
-5.45 -71.45
12481214
-0.82 -71.74
12491215
0.07 -71.68
1216+
0.01 -71.68
1217+
6.57 -70.57
1218+
15.04 -70.44
1219+
25.10 -70.75
1220+
33.37 -69.10
1221+
38.46 -69.77
1222+
42.85 -68.16
1223+
46.59 -67.23
1224+
49.35 -66.96
1225+
52.90 -65.97
1226+
58.46 -67.20
1227+
63.60 -67.58
1228+
70.63 -68.41
1229+
69.24 -70.36
1230+
76.20 -69.44
1231+
88.08 -66.64
1232+
94.98 -66.52
1233+
101.53 -66.09
1234+
111.31 -65.91
1235+
118.64 -66.87
1236+
126.24 -66.24
1237+
133.09 -66.18
1238+
139.85 -66.72
1239+
146.86 -67.96
1240+
153.65 -68.82
1241+
159.94 -69.57
1242+
164.10 -70.67
1243+
170.19 -71.94
1244+
165.68 -74.64
1245+
163.82 -77.60
1246+
162.10 -78.95
1247+
166.72 -82.84
1248+
175.58 -83.86
12501249

12511250
164.65 -77.89
12521251
170.95 -77.37
@@ -1315,6 +1314,3 @@
13151314
-161.20 -79.93
13161315
-163.62 -78.74
13171316

1318-
66.82 66.82
1319-
66.82 66.82
1320-

‎demo/world.dem‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pause -1 "Hit return to continue"
1616
reset
1717
unset key
1818
set border
19+
set xzeroaxis
1920
set yzeroaxis
2021
set xtics
2122
set ytics
@@ -51,7 +52,6 @@ unset arrow
5152
#
5253
# plot a '3D version using cylindrical coordinate system' of the world.
5354
set title "3D version using cylindrical coordinate system"
54-
set ticslevel 0.0
5555
set view 70,40,0.8,1.2
5656
set view equal xy
5757
set mapping cylindrical
@@ -60,6 +60,10 @@ set samples 32
6060
set isosamples 13
6161
set urange [-180:180]
6262
set vrange [-90:90]
63+
set zrange [-90:90]
64+
set xyplane at -110
65+
set ztics 30
66+
6367
splot cos(u),sin(u),v with lines lc rgb "cyan" ,\
6468
'world.dat' with lines lc rgb "blue" lw 2, 'world.cor' with points lt 1 pt 2
6569
pause -1 "Hit return to continue"

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL