# PlotlyJS: how to change the default labels of variables

**URL:** <https://discourse.julialang.org/t/plotlyjs-how-to-change-the-default-labels-of-variables/60798>\
**Category:** General Usage\
**Tags:** plotting, plotlyjs\
**Created:** [May 8, 2021, 11:31pm UTC](https://discourse.julialang.org/t/plotlyjs-how-to-change-the-default-labels-of-variables/60798 "2021-05-08T23:31:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 9, 2021, 8:01pm UTC](https://discourse.julialang.org/t/plotlyjs-how-to-change-the-default-labels-of-variables/60798/2 "2021-05-09T20:01:05Z")

</div>

The following restyling syntax does work:

```julia
using PlotlyJS

Period1 = 1950:2050; u = (Period1 .- 1950)/100;
GDP = u/2; INV = u; CONS = u*2; EXP = 2*u.^0.5;

p2 = PlotlyJS.plot(Period1, [GDP INV CONS EXP],
        Layout(title = "Some macroeconomic aggregates: US (1960-Q1--2019-Q2)",
        xaxis_title = "Quarterly observations",
        xaxis_range = [1960, 2020],
        yaxis_title = "Billions US dollars",
        yaxis_range=[0, 2])
)

restyle!(p2,1:4, name=["GDP", "INV", "CONS", "EXP"])

```

 ![PlotlyJS_edit_labels_restyle](https://global.discourse-cdn.com/julialang/original/3X/d/c/dcd48fd8fc4ba14e3d234deca970495335aae821.png)

---

_[View the full topic](https://discourse.julialang.org/t/plotlyjs-how-to-change-the-default-labels-of-variables/60798)._
