generateme / cljplot

JVM Clojure charting library
Eclipse Public License 2.0
152 stars 7 forks source link

how to order the directionality which graphs in the lattice are arranged? #8

Closed zcaudate closed 5 years ago

zcaudate commented 5 years ago

Currently, graphs in the lattice arrange themselves from the bottom-left, flowing up

(m-1)n  .......  mn-1
...
n  n+1 ... 2n-1
0, 1 .... n-1

to get it starting from the top-left, flowing down, this need to be done:

(build/lattice :line (->> (sort -p-)
                          (reverse)
                          (partition 5)
                          (mapcat reverse)) {} {:grid true :label str :shape [nil 5]})

is there a way to be able to specify the directionality?

0, 1 .... n-1
n  n+1 ... 2n-1
.....
(m-1)n  .......  mn-1
genmeblog commented 5 years ago

No, you can't but you can do this manually or write own builder. actually what lattice function does is injecting :position parameter to the charts configuration.

So having: [:histogram data {}] as a result you have [:histogram data {:position [x,y]}].

genmeblog commented 5 years ago

To have a grid below just add [:grid nil {:position [x,y]}]

zcaudate commented 5 years ago

the x,y being from the bottom left?

genmeblog commented 5 years ago

yes, [0,0] is bottom left.

zcaudate commented 5 years ago

got it. thanks.