Yly
Yly

Reputation: 2330

How to make a log plot in Julia?

Is there a simple way to make a log-log plot or semilog plot in Julia? This link provides a sort of clunky way to do it, but given the general ethos of Julia I suspect there's a shorter way.

Upvotes: 31

Views: 39238

Answers (1)

Yly
Yly

Reputation: 2330

As described here, you can accomplish this with magic arguments yaxis=:log or xaxis=:log.

using Plots 
x = 1:100
# log-log plot
plot(x.^2, xaxis=:log, yaxis=:log)
# semilog plot 
plot(x.^2, xaxis=:log) 

Upvotes: 40

Related Questions