0

Only using Plots, how do I control axis limits? I want that the axis always starts and ends at a tick, not the default expansion by some small space. I couldn't find anything useful in plotattr(:Series).

Code is the standard example:

using Plots
x = 1:10; y = rand(10);
plot(x,y)

Can you help? Thanks.

hooman
  • 35
  • 6

1 Answers1

0

I guess that

plot!(
      xlims=(floor(minimum(x)),ceil(maximum(x))), 
      ylims=(floor(minimum(y)),ceil(maximum(y)))
     )

does the trick.

hooman
  • 35
  • 6