diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-02-21 14:09:55 -0800 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-02-21 14:09:55 -0800 |
commit | 439655aaa40568acd0b4f536e67f6b90031ee147 (patch) | |
tree | c94bc6acc9a526812a862d34673c875e56541a6c /examples/graphs/points.jl | |
parent | 13db261935cd85bc91563999f451bc93081b34de (diff) | |
download | PyX.jl-439655aaa40568acd0b4f536e67f6b90031ee147.tar.gz PyX.jl-439655aaa40568acd0b4f536e67f6b90031ee147.zip |
add examples (all ports from PyX 0.14.1)
Diffstat (limited to 'examples/graphs/points.jl')
-rw-r--r-- | examples/graphs/points.jl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/graphs/points.jl b/examples/graphs/points.jl new file mode 100644 index 0000000..9136ee0 --- /dev/null +++ b/examples/graphs/points.jl @@ -0,0 +1,23 @@ + +# Original Python: +# suggested by Chris Spencer +# from pyx import * +# +# g = graph.graphxy(width=8) +# # either provide lists of the individual coordinates +# g.plot(graph.data.values(x=list(range(10)), y=list(range(10)))) +# # or provide one list containing the whole points +# g.plot(graph.data.points(list(zip(range(10), range(10))), x=1, y=2)) +# g.writeEPSfile("points") +# g.writePDFfile("points") +# g.writeSVGfile("points") + +using PyX + +g = graph.graphxy(width=8) +plot(g, graph_data.values(x=1:10, y=1:10)) +# XXX: x, y syntax in Python3 version only +# XXX: also other errors +#plot(g, graph_data.points([[i i] for i in 1:10], 1:10), x=1, y=2) +writeEPSfile(g, "points") +writePDFfile(g, "points") |