# Plots.jl : Some Odd Attribute Behavior

**URL:** <https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786>\
**Category:** Visualization\
**Created:** [September 10, 2018, 10:50pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786 "2018-09-10T22:50:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [September 10, 2018, 10:50pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786/1 "2018-09-10T22:50:44Z")

</div>

macos, julia 1.0.0.

```julia
julia> using Plots; x= 1:0.1:10; Y= [sin.(x), cos.(x)];

julia> plot( x, Y, tickfontrotation=50 )

julia> savefig("tickfontrotation.png")

```

I am looking the output of the above, and commands like tickfontrotation or tickfonthalign seem to set the tickfontsize, rather than what I would have guessed they were supposed to do.

![tickfontrotation](https://global.discourse-cdn.com/julialang/original/3X/6/1/6183ae5a0976aef4a58c2b66df30978aafa43be5.png)

Am I mistaken?

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 12, 2018, 7:35pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786/2 "2018-09-12T19:35:23Z")

</div>

Where did you find the command `tickfontrotation`? I think you want `xrotation`. I agree that this behavior is a bug, but its not a command that one would try after looking at the documentation.

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [September 12, 2018, 8:11pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786/3 "2018-09-12T20:11:15Z")

</div>

```julia
julia> using Plots

julia> plotattr(:Axis)
Defined Axis attributes are:
discrete_values, flip, foreground_color_axis,
foreground_color_border, foreground_color_grid,
foreground_color_guide, foreground_color_minor_grid,
foreground_color_text, formatter, grid, gridalpha, gridlinewidth,
gridstyle, guide, guidefontcolor, guidefontfamily,
guidefonthalign, guidefontrotation, guidefontsize,
guidefontvalign, lims, link, minorgrid, minorgridalpha,
minorgridlinewidth, minorgridstyle, minorticks, mirror, rotation,
scale, showaxis, tick_direction, tickfontcolor, tickfontfamily,
tickfonthalign, **tickfontrotation** , tickfontsize, tickfontvalign,
ticks, widen

```

tickfontrotation is not the only case. there are many other ones that exhibit the same buggy behavior.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 12, 2018, 8:24pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786/4 "2018-09-12T20:24:29Z")

</div>

Whatever the problem is, it’s definitly this weird chunk of code:

> <https://github.com/JuliaPlots/Plots.jl/blob/340cd0a1fe8bdddfb078e9fbd93d8cf4995cb134/src/components.jl#L259>

You should file an issue about it

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 12, 2018, 8:36pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786/5 "2018-09-12T20:36:14Z")

</div>

Additionally, I think there is confusion about what `plotattr(:Axis)` refers to. It refers to options defined within the `xaxis` and `yaxis` options. The following works:

```julia
plot( x, Y, xaxis = (tickfontrotation = 60.0))

```

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [September 12, 2018, 9:22pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786/6 "2018-09-12T21:22:05Z")

</div>

hi genauguy—can I beg you to file the issue, please? I am just starting with playing around with Plots. A good part of what I might try to explain could be wrong.

for example, as you saw, I did not realize what `plotattr` is supposed to tell me. I am still confused.

```julia
julia> plotattr()
Specify an attribute type to get a list of supported attributes.
 Options are Series, Subplot, Plot, Axis

```

If `plot( x, Y, xaxis = (tickfontrotation = 60.0))`, then how would I use, say, the `dpi=72` (a :Plot option)? Logically, should it be `plot( x, Y, Plot=(dpi=72) )`. This does not work.

So how are all the `plotattr()` from `Series, Subplot, Plot, Axis` supposed to be used (if they are not just stuck into the plot itself), and where would I find documentation on this?

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 12, 2018, 9:37pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786/7 "2018-09-12T21:37:26Z")

</div>

I am not a very experience plots user. But I find the [documentation](http://docs.juliaplots.org/latest/) to be very helpful.

Based on playing around, it looks like `dpi` can be specified at the top level, without going in a function.

```julia
 plot(x, sin.(x), dpi = 74)

```

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [September 12, 2018, 9:41pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786/8 "2018-09-12T21:41:38Z")

</div>

I know. my question was more conceptual, though. when is the attribute an argument to the overall plot, and when is it a tuple handed to a different argument (like xaxis)?

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [September 13, 2018, 3:40pm UTC](https://discourse.julialang.org/t/plots-jl-some-odd-attribute-behavior/14786/9 "2018-09-13T15:40:22Z")

</div>

so I did file issues, and apparently this is a bug (as are some others) and not my ignorance.
