File:Log-log plot example.svg
Summary
Description |
English: Example of a log–log plot with a line |
Date | |
Source | Own work |
Author | M. W. Toews |
SVG development | |
Source code | R codelibrary("sfsmisc")
xlim <- c(1e0, 1e4)
ylim <- c(1e-2, 1e4)
svg("log-log_plot_example.svg", width=4, height=4)
par(mar=c(2.1, 2.6, 0.6, 1.1))
plot.default(x=NA, log="xy",
xlim=xlim, ylim=ylim, bty="n",
xaxt="n", yaxt="n",
xaxs="i", yaxs="i",
xlab=NA, ylab=NA)
# Outer axis ticks and labels
x.minor <- eaxis(1, n.axp=1)
y.minor <- eaxis(2, n.axp=1)
# Draw grid lines
abline(v=x.minor, col="#DDDDDD")
abline(h=y.minor, col="#DDDDDD")
abline(v=10 ^ seq(log10(xlim[1]), log10(xlim[2])), col="#AAAAAA")
abline(h=10 ^ seq(log10(ylim[1]), log10(ylim[2])), col="#AAAAAA")
# Example line
abline(4, -2, col="#000066", lwd=2)
text(10, 200, adj=0,
expression(log[10](italic(F(x))) == -2 * log[10](italic(x)) + 4))
box()
dev.off()
|
Licensing
This file is licensed under the Creative Commons Attribution 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.