# Why in plots，plot can't correctly display chinese

**URL:** <https://discourse.julialang.org/t/why-in-plots-plot-cant-correctly-display-chinese/19511>\
**Category:** New to Julia\
**Created:** [January 11, 2019, 12:49pm UTC](https://discourse.julialang.org/t/why-in-plots-plot-cant-correctly-display-chinese/19511 "2019-01-11T12:49:45Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 11, 2019, 6:30pm UTC](https://discourse.julialang.org/t/why-in-plots-plot-cant-correctly-display-chinese/19511/6 "2019-01-11T18:30:52Z")

</div>

Someone who knows more about CJK in LaTeX may be able to simplify this:

```julia
using PGFPlotsX

# run this just once, to setup PGFPlotsX
PGFPlotsX.latexengine!(PGFPlotsX.PDFLATEX)
push!(PGFPlotsX.CUSTOM_PREAMBLE, raw"\usepackage{CJKutf8}",
      raw"\newcommand{\zh}[1]{\begin{CJK}{UTF8}{gbsn}#1\end{CJK}}")

# the actual plot
p = @pgf Axis({title = raw"\zh{图形}" }, Plot(Coordinates(enumerate(rand(10)))))

# we also save it
pgfsave("/tmp/test.pdf", p)

```

 ![test](https://global.discourse-cdn.com/julialang/original/3X/5/4/54e60bc6ac6d0d1022fd9c6e68888fd6bb27661d.png)

---

_[View the full topic](https://discourse.julialang.org/t/why-in-plots-plot-cant-correctly-display-chinese/19511)._
