aboutsummaryrefslogtreecommitdiffstats
path: root/examples/splitgraphs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/splitgraphs')
-rw-r--r--examples/splitgraphs/minimal.jl25
-rw-r--r--examples/splitgraphs/splitatvalue.jl23
2 files changed, 48 insertions, 0 deletions
diff --git a/examples/splitgraphs/minimal.jl b/examples/splitgraphs/minimal.jl
new file mode 100644
index 0000000..e0e85cf
--- /dev/null
+++ b/examples/splitgraphs/minimal.jl
@@ -0,0 +1,25 @@
+# Original Python:
+# from pyx import *
+
+# g = graph.graphxy(width=8, x=graph.axis.split())
+# g.plot(graph.data.points([((0, 0.1), 0.1),
+# ((0, 0.5), 0.2),
+# ((0, 0.9), 0.3),
+# ((1, 101), 0.7),
+# ((1, 105), 0.8),
+# ((1, 109), 0.9)], x=1, y=2))
+# g.writeEPSfile("minimal")
+# g.writePDFfile("minimal")
+# g.writeSVGfile("minimal")
+
+using PyX
+
+g = graph.graphxy(width=8, x=graph_axis.split())
+plot(g, graph_data.points([((0, 0.1), 0.1),
+ ((0, 0.5), 0.2),
+ ((0, 0.9), 0.3),
+ ((1, 101), 0.7),
+ ((1, 105), 0.8),
+ ((1, 109), 0.9)], x=1, y=2))
+writeEPSfile(g, "minimal")
+writePDFfile(g, "minimal")
diff --git a/examples/splitgraphs/splitatvalue.jl b/examples/splitgraphs/splitatvalue.jl
new file mode 100644
index 0000000..c09d194
--- /dev/null
+++ b/examples/splitgraphs/splitatvalue.jl
@@ -0,0 +1,23 @@
+# Original Python:
+# from pyx import *
+
+# pf = graph.data.paramfunction
+
+# g = graph.graphxy(width=8, x=graph.axis.split())
+# g.plot(pf("k", -1, 1,
+# "x, y = splitatvalue(k, -0.9, 0.9), k**100",
+# points=1000))
+# g.writeEPSfile("splitatvalue")
+# g.writePDFfile("splitatvalue")
+# g.writeSVGfile("splitatvalue")
+
+using PyX
+
+pf = graph_data.paramfunction
+
+g = graph.graphxy(width=8, x=graph_axis.split())
+plot(g, pf("k", -1, 1,
+ "x, y = splitatvalue(k, -0.9, 0.9), k**100",
+ points=1000))
+writeEPSfile(g, "splitatvalue")
+writePDFfile(g, "splitatvalue")