File:Uniform distribution.svg
Summary
| Description |
English: Probability density function for the uniform distribution. |
| Date | |
| Source | Own work |
| Author | Ben Moore |
| Other versions |
|
| SVG development |
Licensing
Ben Moore, the copyright holder of this work, hereby publishes it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
Attribution:
- 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.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Source code
Figure can be generated with the following R code (slightly tweaked in Inkscape afterwards).
svg("figs/uniform.svg", 3.5, 3)
par(mar=c(3,3,0.2,0.2), mgp=c(2,.35,0), lwd=2)
#set up plot area
plot(1:5, seq(0, 3, length.out=5), ylab="",
type="n", axes=F, xlab="", frame=T)
#horizontal blue lines
segments(0,0,2,0, col="blue")
segments(4,0,6,0, col="blue")
segments(2,2,4,2, col="blue")
#axes
axis(1, lwd=1, tck=-.015, at=c(2,4),
labels=c("a", "b"), line=-0)
axis(2, tck=-.015, at=2, label=expression(frac(1,b-a)), las=1)
#vertical dashed lines
segments(2,0,2,2, lty=2, col="blue")
segments(4,0,4,2, lty=2, col="blue")
#points
points(matrix(c(2,0,4,0), ncol=2, byrow=T),
pch=21, bg="white", col="blue")
points(matrix(c(2,2,4,2), ncol=2, byrow=T),
pch=21, col="blue", bg="blue")
dev.off()