Skip to content

Commit 3a47196

Browse files
committed
replace Book chapter 1 with whole book. regen with:
(cd ../pdl-book/; perl make_html_book.pl); perl -pi -e '$_="" if /rev=/; s#PDL/Book/#content/book/#g' content/book/index.html; for x in ../pdl-book/PDL/Book/*; do if [ -d $x ]; then cp -r $x content/book/; fi; done
1 parent 42cdf1a commit 3a47196

File tree

271 files changed

+13162
-411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+13162
-411
lines changed

content/FirstSteps.html

Lines changed: 0 additions & 406 deletions
This file was deleted.
213 KB
87.9 KB

content/book/PGPLOTFigs/ex_bin.8.png

7.95 KB
7.47 KB

content/book/PGPLOTFigs/ex_col1.8.png

97.5 KB
17.7 KB
93.3 KB
7.23 KB

content/book/PGPLOTFigs/ex_env1.8.png

6.77 KB

content/book/PGPLOTFigs/ex_env2.8.png

9.32 KB

content/book/PGPLOTFigs/ex_errb.8.png

10.8 KB
12.8 KB
10.8 KB
27.6 KB
28 KB
15.3 KB
12.6 KB
17 KB
7.36 KB
15.1 KB
6.58 KB
14.9 KB
45.8 KB

content/book/PGPLOTFigs/ex_vec1.8.png

116 KB
28.6 KB
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# conversion for PDF document
2+
# has to be 8 bit PNG and reasonably bigger size
3+
for i in *.pdf; do convert -rotate 90 -resize 800x $i -depth 8 ${i%%.pdf}.8.png; done
4+
#
5+
#
6+
#
7+
# commands used to convert images from LyX book format to png for pod2html
8+
9+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_env2.pdf PGPLOTFigs/ex_env2.png
10+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_points.pdf PGPLOTFigs/ex_points.png
11+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_points2.pdf PGPLOTFigs/ex_points2.png
12+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_errb.pdf PGPLOTFigs/ex_errb.png
13+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_errb2.pdf PGPLOTFigs/ex_errb2.png
14+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_line1.pdf PGPLOTFigs/ex_line1.png
15+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_bin.pdf PGPLOTFigs/ex_bin.png
16+
convert -rotate 90 -resize 300x PGPLOTFigs/linepoly_ex.pdf PGPLOTFigs/linepoly_ex.png
17+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_imag1.pdf PGPLOTFigs/ex_imag1.png
18+
convert -rotate 90 -resize 500x PGPLOTFigs/ex_imag2.pdf PGPLOTFigs/ex_imag2.png
19+
convert -rotate 90 -resize 500x PGPLOTFigs/eg_wedge.ps PGPLOTFigs/eg_wedge.png
20+
convert -rotate 90 -resize 500x PGPLOTFigs/eg_cont1.ps PGPLOTFigs/ex_cont1.png
21+
convert -rotate 90 -resize 500x PGPLOTFigs/ex_cont1.pdf PGPLOTFigs/ex_cont1.png
22+
convert -rotate 90 -resize 500x PGPLOTFigs/ex_cont2.pdf PGPLOTFigs/ex_cont2.png
23+
convert -rotate 90 -resize 500x PGPLOTFigs/ex_vec1.pdf PGPLOTFigs/ex_vec1.png
24+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_circle1.pdf PGPLOTFigs/ex_circle1.png
25+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_ellipse1.pdf PGPLOTFigs/ex_ellipse1.png
26+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_rect1.pdf PGPLOTFigs/ex_rect1.png
27+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_text1.pdf PGPLOTFigs/ex_text1.png
28+
convert -rotate 90 -resize 500x PGPLOTFigs/ex_legend1.pdf PGPLOTFigs/ex_legend1.png
29+
convert -rotate 90 -resize 500x PGPLOTFigs/ex_col1.pdf PGPLOTFigs/ex_col1.png
30+
convert -resize 600x PGPLOTFigs/ColorTables.png PGPLOTFigs/ColorTables2.png
31+
convert -rotate 90 -resize 300x PGPLOTFigs/ex_tline1.pdf PGPLOTFigs/ex_tline1.png
32+
38.3 KB
38.3 KB
38.2 KB
213 KB
82.8 KB
222 KB
10.8 KB
7.42 KB
12 KB
3.23 KB
7.98 KB
6.94 KB
364 KB
12.3 KB
32.6 KB
120 KB
6.62 KB
6.06 KB
3.53 KB
7.95 KB
8.24 KB
11.3 KB
13.7 KB
9.49 KB
70.9 KB
29.2 KB
23.4 KB
11.1 KB
14.7 KB
6.58 KB
13 KB
6.11 KB
12.3 KB
37.7 KB
10.4 KB
193 KB
90 KB
20.4 KB

content/book/PLplot/data/earth.jpg

92.5 KB

content/book/PLplot/w00.pl.800.png

248 KB

content/book/PLplot/w01.pl.800.png

18 KB

content/book/PLplot/w02.pl.800.png

29.2 KB

content/book/PLplot/w03.pl.800.png

57.6 KB

content/book/PLplot/w04.pl.800.png

63.1 KB

content/book/PLplot/w05.pl.800.png

60.8 KB

content/book/PLplot/w06.pl.800.png

60.3 KB

content/book/PLplot/w07.pl.800.png

60.4 KB

content/book/PLplot/w08.pl.800.png

64.1 KB

content/book/PLplot/w08a.pl.800.png

65 KB

content/book/PLplot/w09.pl.800.png

45.1 KB

content/book/PLplot/w10.pl.800.png

21.7 KB

content/book/PLplot/w11.pl.800.png

73.7 KB

content/book/PLplot/w12.pl.800.png

92.6 KB

content/book/PLplot/w13.pl.800.png

46.5 KB

content/book/PLplot/w14.pl.800.png

19.8 KB

content/book/PLplot/w15.pl.800.png

24.8 KB

content/book/PLplot/w16.pl.800.png

29.5 KB

content/book/PLplot/w17.pl.800.png

56.1 KB

content/book/PLplot/w18.pl.800.png

36.9 KB

content/book/PLplot/w19.pl.800.png

40.1 KB

content/book/PLplot/w20.pl.800.png

36.2 KB

content/book/PLplot/w21.pl.800.png

46.9 KB

content/book/PLplot/w22.pl.800.png

122 KB

content/book/PLplot/w23.pl.800.png

22.3 KB

content/book/PLplot/w24.pl.800.png

19.9 KB

content/book/PLplot/w25.pl.800.png

22.5 KB

content/book/PLplot/w26.pl.800.png

20.2 KB

content/book/PLplot/w27.pl.800.png

16.4 KB

content/book/PLplot/w29.pl.800.png

905 KB

content/book/PLplot/w30.pl.800.png

49.7 KB

content/book/PLplot/w30a.pl.800.png

65.9 KB

content/book/PLplot/w31.pl.800.png

47.8 KB

content/book/PLplot/w32.pl.800.png

43.5 KB

content/book/PLplot/w33.pl.800.png

50.5 KB

content/book/PLplot/work/w01.pl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/perl
2+
use warnings;
3+
use strict;
4+
use PDL;
5+
use PDL::Graphics::PLplot;
6+
7+
my $pl = PDL::Graphics::PLplot->new( DEV => "xwin");
8+
my $x = sequence( 10 );
9+
my $y = $x**2;
10+
$pl->xyplot( $x, $y );
11+
$pl->close;
12+

content/book/PLplot/work/w02.pl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/perl
2+
use warnings;
3+
use strict;
4+
use PDL;
5+
use PDL::Graphics::PLplot;
6+
7+
# Generate a time series
8+
my $time = sequence(100)/10;
9+
my $sinewave = 5 * sin($time);
10+
# Create the PLplot object: use xwin for display
11+
my $pl = PDL::Graphics::PLplot->new( DEV => "xwin");
12+
13+
# Plot the time series
14+
$pl->xyplot($time, $sinewave
15+
, XLAB => 'time [s]'
16+
, YLAB => 'position [cm]'
17+
, TITLE => 'Mass on Spring'
18+
);
19+
# Close the PLplot object to finalize
20+
$pl->close;

content/book/PLplot/work/w03.pl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/perl
2+
use warnings;
3+
use strict;
4+
use PDL;
5+
use PDL::Graphics::PLplot;
6+
7+
# Generate a time series
8+
my $time = sequence(100)/10;
9+
my $sinewave = 5 * sin($time);
10+
11+
12+
# Create the PLplot object: use wxwidgets for display
13+
# wxwidgets allows saving to many file types, and
14+
# has a Locate function under the Plot menu entry
15+
# providing interactive crosshairs to read individual plot values
16+
17+
my $pl = PDL::Graphics::PLplot->new( DEV => "wxwidgets");
18+
19+
# Plot the time series
20+
$pl->xyplot($time, $sinewave
21+
, XLAB => 'time [s]'
22+
, YLAB => 'position [cm]'
23+
, TITLE => 'Mass on Spring'
24+
);
25+
# Close the PLplot object to finalize
26+
$pl->close;

content/book/PLplot/work/w04.pl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use PDL::Graphics::PLplot;
6+
7+
# Generate a time series
8+
my $time = sequence(100)/10;
9+
my $sinewave = 5 * sin($time);
10+
11+
# Save the image to a postscript file
12+
13+
my $pl = PDL::Graphics::PLplot->new(
14+
DEV => 'pscairo'
15+
, FILE => 'Symbols.eps'
16+
);
17+
18+
# Plot the time series as points
19+
$pl->xyplot($time, $sinewave
20+
, PLOTTYPE => 'POINTS'
21+
, SYMBOL => 843
22+
, YERRORBAR => grandom($time)/2
23+
);
24+
25+
$pl->close;

content/book/PLplot/work/w05.pl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use aliased 'PDL::Graphics::PLplot';
6+
7+
# Generate a time series
8+
my $time = sequence(100)/10;
9+
my $sinewave = 5 * sin($time);
10+
my $cosinewave = 4 * cos($time);
11+
my $toplot = cat($sinewave, $cosinewave);
12+
13+
# Save the image to a postscript file
14+
15+
my $pl = PLplot->new(
16+
DEV => 'pscairo'
17+
, FILE => 'Multidimensional.eps'
18+
);
19+
20+
21+
# Plot the time series
22+
$pl->xyplot($time, $toplot);
23+
24+
$pl->close;

content/book/PLplot/work/w06.pl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use aliased 'PDL::Graphics::PLplot';
6+
7+
my $pl = PLplot->new(
8+
DEV => 'pscairo',
9+
FILE => 'Multidimensional2.eps');
10+
11+
# Generate a time series and phase offset
12+
my $time = sequence(100)/10;
13+
my $phi = zeroes(4)->xlinvals(0, 3)->transpose;
14+
15+
my $sinewaves = 5*sin($time + $phi);
16+
# Plot the time series and phi color key
17+
$pl->xyplot($time, $sinewaves,
18+
PLOTTYPE => 'POINTS',
19+
COLORMAP => $phi,
20+
TITLE => 'sin(x + #gf)');
21+
22+
$pl->colorkey($phi, 'v',
23+
TITLE => '#gf',
24+
VIEWPORT => [0.93, 0.96, 0.15, 0.85]);
25+
$pl->close;

content/book/PLplot/work/w07.pl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use aliased 'PDL::Graphics::PLplot';
6+
7+
# Generate a time series
8+
my $time = sequence(100)/10;
9+
my $sinewave = 5 * sin($time);
10+
my $cosinewave = 4 * cos($time);
11+
12+
# Save the image to a postscript file
13+
my $pl = PLplot->new(
14+
DEV => 'pscairo',
15+
FILE => 'Multiple curves.eps'
16+
);
17+
18+
# Plot the sine in black, cosine in red
19+
$pl->xyplot($time, $sinewave);
20+
$pl->xyplot($time, $cosinewave , COLOR => 'RED');
21+
22+
$pl->close;

content/book/PLplot/work/w08.pl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use aliased 'PDL::Graphics::PLplot';
6+
7+
# Generate a time series
8+
my $time = sequence(100)/10;
9+
my $sinewave = 5 * sin($time);
10+
my $cosinewave = 6 * cos($time);
11+
12+
# Save the image to a postscript file
13+
my $pl = PLplot->new(
14+
DEV => 'pscairo',
15+
FILE => 'Multiple curves3.eps'
16+
);
17+
18+
# Plot the sine with full bounds
19+
$pl->xyplot($time, $sinewave,
20+
BOX => [$time->minmax, $cosinewave->minmax]);
21+
22+
# Plot the cosine in red
23+
$pl->xyplot($time, $cosinewave , COLOR => 'RED');
24+
25+
$pl->close;

content/book/PLplot/work/w09.pl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use aliased 'PDL::Graphics::PLplot';
6+
7+
# Save the image to a postscript file
8+
my $pl = PLplot->new(
9+
DEV => 'pscairo',
10+
FILE => 'stripplots.eps'
11+
);
12+
13+
# Generate a time series
14+
my $time = sequence(100)/10;
15+
16+
# Make stripplots with the
17+
# different time series
18+
$pl->stripplots($time,
19+
[sin($time), cos($time)],
20+
XLAB => 'x',
21+
YLAB => ['sine', 'cosine'],
22+
COLOR => ['BLUE', 'RED'],
23+
TITLE => 'Sine and Cosine'
24+
);
25+
26+
$pl->close;

content/book/PLplot/work/w10.pl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use PDL::Graphics::PLplot;
6+
7+
my ($t, $data) = rcols(*DATA, 0, []);
8+
9+
my $pl = PDL::Graphics::PLplot->new( DEV => "xwin" );
10+
11+
# Make stripplots with the different time series
12+
# notice data must be transposed
13+
14+
$pl->stripplots($t, $data->transpose);
15+
16+
$pl->close;
17+
18+
__DATA__
19+
# t x1 x2 x3
20+
1 4 6 -1
21+
2 3 9 3
22+
3 2 8 7
23+
3 -1 4 10
24+
5 1 2 6
25+
6 5 -1 5
26+

content/book/PLplot/work/w11.pl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use aliased 'PDL::Graphics::PLplot';
6+
7+
# Generate a time series
8+
my $time = sequence(100)/10;
9+
10+
# Save the image to a postscript file
11+
my $pl = PLplot->new(
12+
DEV => 'pscairo',
13+
FILE => 'subpages.eps',
14+
SUBPAGES => [2,2]);
15+
16+
# Plot the time series
17+
$pl->xyplot($time, sin($time), TITLE => 'Sine');
18+
19+
$pl->xyplot($time, cos($time), TITLE => 'Cosine',
20+
SUBPAGE => 0);
21+
22+
$pl->xyplot($time, tan($time), TITLE => 'Tangent',
23+
SUBPAGE => 4);
24+
25+
$pl->xyplot($time, $time**2, TITLE => 'Squared',
26+
SUBPAGE => 3);
27+
28+
$pl->close;

content/book/PLplot/work/w12.pl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL::Graphics::PLplot;
5+
use PDL;
6+
use PDL::NiceSlice;
7+
8+
# Generate a noisy time series
9+
my $time = sequence(1000) /10;
10+
my $sinewave = 1 * sin($time) + grandom($time) / 3;
11+
12+
# Save the image to a postscript file
13+
my $pl = PDL::Graphics::PLplot->new( DEV => 'pscairo', FILE => 'inset.eps');
14+
15+
# Plot subset as the main plot
16+
$pl->xyplot($time(0:65), $sinewave(0:65), TITLE => 'Noisy Pendulum',
17+
YLAB => 'Displacement d [m]', XLAB => 'Time t [s]');
18+
19+
# Plot full data set as inset
20+
$pl->xyplot($time, $sinewave,
21+
TITLE => undef,
22+
VIEWPORT => [0.525, 0.825, 0.525, 0.775],
23+
BOX => [$time->minmax, $sinewave->minmax],
24+
CHARSIZE => 0.6
25+
);
26+
$pl->close;

content/book/PLplot/work/w13.pl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use aliased 'PDL::Graphics::PLplot';
6+
7+
my $x = zeroes(20)->xlinvals(-3, 3);
8+
my $y = $x**2;
9+
10+
# Set a custom page size
11+
my $pl = PLplot->new(
12+
DEV => 'pscairo',
13+
FILE => 'box example 2.eps',
14+
BACKGROUND => 'SKYBLUE',
15+
PAGESIZE => [360, 240]
16+
);
17+
18+
# Plot a quadratic function:
19+
$pl->xyplot($x, $y, YLAB => 'y', XLAB => 'x');
20+
21+
$pl->close;

content/book/PLplot/work/w14.pl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use aliased 'PDL::Graphics::PLplot';
6+
7+
my $x = zeroes(20)->xlinvals(-3, 3);
8+
my $y = $x**2;
9+
10+
my $pl = PLplot->new(
11+
DEV => 'pscairo',
12+
FILE => 'box example 3.eps',
13+
BACKGROUND => 'SKYBLUE'
14+
);
15+
16+
# Put the plot in the upper right:
17+
$pl->xyplot($x, $y,
18+
YLAB => 'y',
19+
XLAB => 'x',
20+
VIEWPORT => [0.5, 0.9, 0.6, 0.8]
21+
);
22+
23+
$pl->close;

content/book/PLplot/work/w15.pl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
use PDL;
5+
use aliased 'PDL::Graphics::PLplot';
6+
7+
my $x = zeroes(20)->xlinvals(-3, 3);
8+
my $y = $x**2;
9+
my $pl = PLplot->new(
10+
DEV => 'pscairo',
11+
FILE => 'box example 4.eps',
12+
BACKGROUND => 'SKYBLUE'
13+
);
14+
15+
# Center the plot
16+
$pl->xyplot($x, $y,
17+
YLAB => 'y', XLAB => 'x',
18+
VIEWPORT => [0.3, 0.7, 0.3, 0.7]
19+
);
20+
21+
$pl->close;

0 commit comments

Comments
 (0)