Closed jimka2001 closed 5 months ago
I found this source: https://vega.github.io/vega-lite/docs/size.html
I've added :width
and :height
to the data and it seems to work.
{:data {:values polished-data}
:width 600
:height 600
:title {:text chart-title}
:description chart-title
:axes [{:orient "bottom"
:title x-label}
{:orient "left"
:title y-label}]
:encoding {:x {:field x-label
:type "quantitative"}
:y {:field y-label
:type "quantitative"}
:color {:field "series"
:type "nominal"}}
:mark "line"}
This is a very similar issue as another I filed a few seconds ago.
I have a clojure function,
series-format-plot-data
, defined here https://github.com/jimka2001/clojurein-student/blob/ce1e21511a04d17f851a294f39fcf7b457f4427e/clojurein-source-code/src/lecture/vega_plot.clj#L8 which creates a plot usingoz
. I can't figure out how to set the size of the image file.When I call the function, sample-plot-2, defined here https://github.com/jimka2001/clojurein-student/blob/ce1e21511a04d17f851a294f39fcf7b457f4427e/clojurein-source-code/src/lecture/baby_name_plot.clj#L98 I get a graphs of the following size. I'd like to have larger images.
The basic data structure I'm passing in a file to
oz/export!
is the following. I'm hoping it is possible to declare the size in cm or pixels somewhere in this format.