# Plot problem

**URL:** https://discourse.julialang.org/t/plot-problem/11586
**Category:** Visualization
**Created:** [June 11, 2018, 1:36pm UTC](https://discourse.julialang.org/t/plot-problem/11586 "2018-06-11T13:36:51Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jcrbloch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcrbloch/32/4396_2.png) [@jcrbloch](https://discourse.julialang.org/u/jcrbloch)
#### Post date: [June 11, 2018, 1:36pm UTC](https://discourse.julialang.org/t/plot-problem/11586/1 "2018-06-11T13:36:51Z")

</div>

Many of my plots are cut off at the top. For example:  
pyplot()  
plot(xlabel=“s”,ylabel=“Re(f)”)  
plot!(T.s1,T.f1,color=:blue)  
plot!(T.s2,T.f2,color=:blue)

[f\_w%3D10|600x450](https://discourse.julialang.org/uploads/short-url/exTbKoMBh5GkfAnCM8gkEyVjNly.png)

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [June 12, 2018, 1:38am UTC](https://discourse.julialang.org/t/plot-problem/11586/2 "2018-06-12T01:38:03Z")

</div>

Please provide a minimum working example including all data and code, and quote your code using backticks.

---

<div class="post-metadata">

### Author: ![jcrbloch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcrbloch/32/4396_2.png) [@jcrbloch](https://discourse.julialang.org/u/jcrbloch)
#### Post date: [June 12, 2018, 11:19am UTC](https://discourse.julialang.org/t/plot-problem/11586/3 "2018-06-12T11:19:44Z")

</div>

Dear David,

Here is a minimal example with figure:

y=[1, 9, 9, 1]

plot!(y)

savefig(“y.pdf”)

The error seems to occur when the maximum is a line rather than a single point.

Jacques

![y](https://global.discourse-cdn.com/julialang/original/3X/2/6/261d2914af6dc30cbb33c18c73da66cc1953fcbd.png)

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [June 12, 2018, 2:06pm UTC](https://discourse.julialang.org/t/plot-problem/11586/4 "2018-06-12T14:06:13Z")

</div>

You could do

`ylims!(9.5)`

I agree that there seem to be some issues when points fall at the plot limit.

---

<div class="post-metadata">

### Author: ![jcrbloch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcrbloch/32/4396_2.png) [@jcrbloch](https://discourse.julialang.org/u/jcrbloch)
#### Post date: [June 12, 2018, 2:21pm UTC](https://discourse.julialang.org/t/plot-problem/11586/5 "2018-06-12T14:21:00Z")

</div>

Obviously, setting the limits by hand is what I am doing, but I was rather looking for the reason of this problem and for an actual solution to it.

The problem is only happening when using pyplot() as a backend to Plots, it is not happening when using PyPlot directly. I don’t know if it also happens with other backend to Plots.

---

<div class="post-metadata">

### Author: ![daschw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daschw/32/2926_2.png) [@daschw](https://discourse.julialang.org/u/daschw)
#### Post date: [June 13, 2018, 2:22pm UTC](https://discourse.julialang.org/t/plot-problem/11586/6 "2018-06-13T14:22:38Z")

</div>

See also [https://github.com/JuliaPlots/Plots.jl/issues/1366](https://github.com/JuliaPlots/Plots.jl/issues/1366).  
@mkborregaard’s suggestion of widening the axes for all series types would probably fix the issue described here.
