Reputation: 103
I'm plotting the function tan
but it's not rendered cleanly because the point density is too low around Inf values.
using Plots
plot(x -> tan(x), 1, 10)
How can I increase point density ? I don't see it in the documentation.
Upvotes: 3
Views: 117
Reputation: 103
I found the syntax :
plot(x -> tan(x), 1:0.0001:10, ylims=(-20, 20))
with this the x axis goes from 1 to 10 with a step of 0.0001
Upvotes: 2
Reputation: 4370
The simplest way is just to explicitly specify a vector of x
points:
using Plots
x = 0:0.001:10
plot(x, tan.(x), xlims=(0,10), ylims=(-1000,1000))
Upvotes: 0