Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added some gridded matrix things to the demos

  • Loading branch information...
commit d6181e3dfc2177fd819db5c980b28e9ab232634b 1 parent 375be60
Dima Kogan authored July 24, 2012

Showing 1 changed file with 72 additions and 0 deletions. Show diff stats Hide diff stats

  1. 72  demo.pl
72  demo.pl
@@ -147,6 +147,78 @@
147 147
        tuplesize => 2, with => 'lines', $x, 20*cos($x/20 * 3.14159/2) );
148 148
 }
149 149
 
  150
+
  151
+
  152
+################################
  153
+# 2D implicit domain tests
  154
+################################
  155
+{
  156
+  my $xy = zeros(21,21)->ndcoords - pdl(10,10);
  157
+  my $x = $xy((0),:,:);
  158
+  my $z = sqrt(inner($xy, $xy));
  159
+
  160
+  $xy = $xy(2:12,:);
  161
+  $x  = $x(2:12,:);
  162
+  $z  = $z(2:12,:);
  163
+
  164
+  # single 3d matrix curve
  165
+  plot(title  => 'Single 3D matrix plot. Binary.', binary => 1,
  166
+       square => 1,
  167
+       tuplesize => 3, with => 'points palette pt 7',
  168
+       $z);
  169
+
  170
+  # 4d matrix curve
  171
+  plot(title  => '4D matrix plot. Binary.', binary => 1,
  172
+       square => 1,
  173
+       tuplesize => 4, with => 'points palette ps variable pt 7',
  174
+       $z, $x);
  175
+
  176
+  # 2 3d matrix curves
  177
+  plot(title  => '2 3D matrix plots. Binary.', binary => 1,
  178
+       square => 1,
  179
+       {tuplesize => 3, with => 'points palette pt 7'},
  180
+       {with => 'points ps variable pt 6'},
  181
+       $x->cat($z));
  182
+
  183
+  # # Gnuplot doesn't support this
  184
+  # # 4d matrix curve
  185
+  # plot(title  => '4D matrix plot. ASCII.', binary => 0,
  186
+  #      square => 1,
  187
+  #      tuplesize => 4, with => 'points palette ps variable pt 7',
  188
+  #      $z, $x);
  189
+
  190
+  # 2 3d matrix curves
  191
+  plot(title  => '2 3D matrix plots. ASCII.', binary => 0,
  192
+       square => 1,
  193
+       {tuplesize => 3, with => 'points palette pt 7'},
  194
+       {with => 'points ps variable pt 6'},
  195
+       $x->cat($z));
  196
+}
  197
+
  198
+###################################
  199
+# fancy contours just because I can
  200
+###################################
  201
+{
  202
+  my $x = zeros(61,61)->xvals - 30;
  203
+  my $y = zeros(61,61)->yvals - 30;
  204
+  my $z = sin($x / 4) * $y;
  205
+
  206
+  # single 3d matrix curve
  207
+  plot('3d' => 1,
  208
+       title  => 'matrix plot with contours',
  209
+       extracmds => [ 'set contours base',
  210
+                      'set cntrparam bspline',
  211
+                      'set cntrparam levels 15',
  212
+                      'unset grid',
  213
+                      'unset surface',
  214
+                      'set view 0,0'],
  215
+       square => 1,
  216
+       tuplesize => 3, with => 'image', $z,
  217
+       tuplesize => 3, with => 'lines', $z
  218
+      );
  219
+}
  220
+
  221
+
150 222
 ################################
151 223
 # testing some error detection
152 224
 ################################

0 notes on commit d6181e3

Please sign in to comment.
Something went wrong with that request. Please try again.