# Issue with Plots.scalefontsizes()

**URL:** <https://discourse.julialang.org/t/issue-with-plots-scalefontsizes/60050>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [April 26, 2021, 6:54pm UTC](https://discourse.julialang.org/t/issue-with-plots-scalefontsizes/60050 "2021-04-26T18:54:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregory/32/18969_2.png) [@gregory](https://discourse.julialang.org/u/gregory)\
**Post date:** [April 26, 2021, 6:54pm UTC](https://discourse.julialang.org/t/issue-with-plots-scalefontsizes/60050/1 "2021-04-26T18:54:23Z")

</div>

A MWE of my issue:

```julia
function testPlot(α::Real=1.0)

	Plots.scalefontsizes(α)
	p1=plot(rand(10),title="mytitle")
	Plots.scalefontsizes()

	return p1

end

```

The title is scaled appropriately, but the ticks are not changed. My actual function computes \alpha based on the number of subfigures in the layout (if that is important). According to this answer [julia - How to scale the fontsizes using Plots.jl - Stack Overflow](https://stackoverflow.com/questions/57976378/how-to-scale-the-fontsizes-using-plots-jl), `p1` should be scaled according to \alpha and subsequent plots set back to default, but this does not seem to be the case. Any help would be appreciated.

---

<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:** [April 26, 2021, 11:01pm UTC](https://discourse.julialang.org/t/issue-with-plots-scalefontsizes/60050/2 "2021-04-26T23:01:01Z")

</div>

If you move `Plots.scalefontsizes()` to the first line of the function (to reset the scaling), it seems to work.

```julia
function testPlot(α::Real=1.0)
    Plots.scalefontsizes()
	Plots.scalefontsizes(α)
	p1=plot(rand(10),title="mytitle")
	return p1
end

using Plots; gr()
testPlot(2.0)
testPlot(0.5)
testPlot()

```

---

<div class="post-metadata">

**Author:** ![gregory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregory/32/18969_2.png) [@gregory](https://discourse.julialang.org/u/gregory)\
**Post date:** [April 26, 2021, 11:47pm UTC](https://discourse.julialang.org/t/issue-with-plots-scalefontsizes/60050/3 "2021-04-26T23:47:39Z")

</div>

The new default fontsize is still scaled by alpha after the call so that if I do

```julia
testPlot(0.5)
plot(rand(10),title="mytitle")

```

the second plot still has the \alpha fontsize and has not been reset back to default. I guess if I use this command, I need to restore to default after the function call.

---

<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:** [April 26, 2021, 11:59pm UTC](https://discourse.julialang.org/t/issue-with-plots-scalefontsizes/60050/4 "2021-04-26T23:59:28Z")

</div>

That seems to be the principle of the whole shebang.
