# Matrix Formatting in JSON.print()

**URL:** <https://discourse.julialang.org/t/matrix-formatting-in-json-print/44714>\
**Category:** Data\
**Tags:** json\
**Created:** [August 10, 2020, 10:15pm UTC](https://discourse.julialang.org/t/matrix-formatting-in-json-print/44714 "2020-08-10T22:15:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdoolittle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bdoolittle/32/17053_2.png) [@bdoolittle](https://discourse.julialang.org/u/bdoolittle)\
**Post date:** [August 10, 2020, 10:15pm UTC](https://discourse.julialang.org/t/matrix-formatting-in-json-print/44714/1 "2020-08-10T22:15:15Z")

</div>

I would like to print a JSON structure which includes nicely formed matrices. The goal is for data to be human-readable. Ideally, the dictionary `Dict("matrix" => [1 2 3;4 5 6;7 8 9])` would be printed like,

```julia
{
    "matrix" : [
         [1, 2, 3],
         [4, 5, 6],
         [7, 8, 9]
    ]
}

```

The default behavior of JSON.jl (using indentations), is to place a newline after every comma in the matrix. This ends up being hard to read data.

Is there a way to customize `JSON.Writer.StructuralContext` to achieve the desired result?
