generated from erosita/uds
Initial commit
This commit is contained in:
20
data/4XMM-DR12/barplot.r
Normal file
20
data/4XMM-DR12/barplot.r
Normal file
@@ -0,0 +1,20 @@
|
||||
library(ggplot2)
|
||||
|
||||
# see https://r-graph-gallery.com/4-barplot-with-error-bar.html
|
||||
|
||||
png(file = "barplot.png")
|
||||
|
||||
# create dummy data
|
||||
data <- data.frame(
|
||||
name=c('','yy','zz','ff','DR12'),
|
||||
flux=c(1,2,3,4,5),
|
||||
err=c(1,0.2,3,2,4)
|
||||
)
|
||||
|
||||
# Most basic error bar
|
||||
ggplot(data) +
|
||||
geom_bar(aes(x=name, y=flux), stat="identity", fill="skyblue", alpha=0.7) +
|
||||
geom_errorbar( aes(x=name, ymin=flux-err, ymax=flux+err), width=0.4, colour="black", alpha=0.9, linewidth=2)
|
||||
|
||||
|
||||
dev.off()
|
Reference in New Issue
Block a user