Subversion Repositories bdplot

Rev

Rev 58 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 pdel 1
## hvad hvis mfrow er NA?  hvad er columns? den kan kun saettes til 1,
2
## det virker maerkeligt... Er det til artikler, hvor man ofte skriver
3
## i to spalter? Hvad saa med en "a4.2col" paper?
4
 
5
## What about a beamer mode?
6
 
7
 
8
.bdconf.default <- function( columns=1, half=FALSE, quadratic=FALSE)
9
  {
10
    ##Global and control parameters
11
    .BDPars <- list()
12
    ## This will be put in front of filenames. Set to NA, NULL or "" to omit.
44 pdel 13
    .BDPars$figdir <- NA
5 pdel 14
    ## Choose paper size for automatic figure sizing. Only "b5" implemented
47 pdel 15
    .BDPars$paper <- "a4"
5 pdel 16
    ## This should probably not have a default value different from NA
17
    .BDPars$file <- NA
18
 
19
    ##
20
    .BDPars$mfrow <- c(1,1)
21
 
22
    ## Default plotting method, i.e. type of plot. One of
23
    ## "xy", "histogram", "image.plot", "barplot" and "acf".
24
    ## This part is likely to be changed in the future.
25
    ## "xy" is like plot(x), plot(x,y). Don't confuse with xyplot from
26
    ## lattice.
27
    .BDPars$method <- "xy"
28
 
29
    ## When plotting in xy mode, this is type in plot(). The possibilities are "n", "o", "l" (at least, see ?plot). for plot(), default is "p". Notice, this is also the default for bdxyadd.
30
    .BDPars$type <- "p"
31
 
37 pdel 32
    ## Nice to put to something default if you (almost) always use x
5 pdel 33
    ## and y labels and you want to substitute them with psfrag
34
    ## anyway.
37 pdel 35
    ##    .BDPars$xlab <- "longxlabel"
36
    ##    .BDPars$ylab <- "longylabel"
37
    ## otherwise we'll stick to the R standard
38
    .BDPars$xlab <- NULL
39
    .BDPars$ylab <- NULL
42 pdel 40
 
41
    ## Ph thinks these shoud be called tlab, rlab
42
    .BDPars$tlab <- NA
43
    .BDPars$rlab <- NA
44
    ## but kept for back-compatibility.
5 pdel 45
    .BDPars$toplab <- NA
46
    .BDPars$rightlab <- NA        
47
 
48
    ## You probably don't want a default here. 
49
    .BDPars$xlim <- NULL
50
    .BDPars$ylim <- NULL
34 pdel 51
 
52
    ## "s" is the default R axis method
53
    .BDPars$xaxt <- "s"
54
    .BDPars$yaxt <- "s"
55
## these must be implemented differently
12 pdel 56
    .BDPars$draw.raxis <- FALSE
31 pdel 57
    .BDPars$draw.taxis <- FALSE
5 pdel 58
 
34 pdel 59
 
60
 
5 pdel 61
    .BDPars$grid <- FALSE
62
    .BDPars$grid.lwd <- 0.3
63
    ## what are these? NA/TRUE/"Def"? 
64
    .BDPars$grid.h <- NA
65
    .BDPars$grid.v <- NA
66
 
67
    .BDPars$grid.col <- "grey50"
68
 
69
 
70
    ## controls - at least - size of point characters
71
    .BDPars$cex.plot <- 0.4
72
 
73
    ## See ?par
74
    .BDPars$cex.main <- .7
51 pdel 75
    .BDPars$cex.sub <- .5
5 pdel 76
    ##
77
    ## This has no effect on the axis label sizes if they are
78
    ## substituted with psfrag.
79
    .BDPars$cex.lab <- .6
80
    ## font size on the axis indexing
81
    .BDPars$cex.axis <- .5
82
    ## line width
83
    .BDPars$lwd <- 0.5
84
    ## length of tick marks. positive values put the ticks inside the
85
    ## plots.
86
    .BDPars$tcl <- -.2
87
 
88
    ## cex for legends. Legends are not written by pbp. But you
89
    ## may want to save your default anyway. It's used by bd.legend()
26 pdel 90
    .BDPars$cex.legend <- .5
5 pdel 91
    ## a default position
92
    .BDPars$pos.legend <- "topright"
93
    ## And a default background color: Is NA transparancy?
94
    ## This is not a background for the whole frame, it is for shapes.
95
    .BDPars$bg.legend <- "white"
96
 
97
    ## col controls the color of the plot.
98
    .BDPars$col <- "black"
99
 
100
    ## box around the plot.
101
    .BDPars$bty <- "o"
102
 
103
    ## the default plotting character for points
104
    .BDPars$pch <- 21
105
 
106
### Margins
107
    ## It may be tempting to omit a top margin or make it very small
108
    ## when there is no top label. But remember that sometimes numbers
109
    ## on the x axis exceed the plot region. If you make it very small,
110
    ## remember to check that for each plot, you may have to do some
111
    ## exceptions then.
112
 
113
    ##c(bottom, left, top, right)
114
    .BDPars$mar.nolab <- c(1.5, 1, 0.4, 0.3)
12 pdel 115
    .BDPars$mar.lab <-  c(2.1, 2.1, 2.1, 2.1)
5 pdel 116
    ## This one can not be set with commands since it is used in this
117
    ## function.
58 pdel 118
    .BDPars$mar.lab.half <- c(2.1, 1.9, 1.9, 1.9)
5 pdel 119
    ##c(2,  2, 1.5, 1.35)
58 pdel 120
 
121
    ## In case there is a main title, how much extra top margin
122
    .BDPars$mar.main <- 2
5 pdel 123
 
124
    ## What exactly do these do?
125
    ## some control of distances from axis to text?
126
    ## mgp for axis commands.
127
    ## Only used if .BDPars$draw.xaxis=TRUE
128
    ## (?,,)
66 pdel 129
    .BDPars$mgp.xaxis <- c(.7, -.3, 0)
5 pdel 130
    ## Only used if .BDPars$draw.yaxis=TRUE
131
    .BDPars$mgp.yaxis <- c(1, 0.15, 0)
12 pdel 132
    .BDPars$mgp.raxis <- c(1.2, 0.15, 0)
5 pdel 133
    ## This (only first element?) has effect if axis labels are written
134
    ## by the plot command. It can also be written by the mtext
135
    ## command. Only one of these methods should be used in the
136
    ## future. I think the mtext way is more flexible, but then the
137
    ## distance should be calculated from the mgp.axis in stead of from
138
    ## the ?labLine. If not, these use different units which is
139
    ## confusing.
140
    ## (plotbox to labs, axis to axislabs,plotbox to axis)
141
    .BDPars$mgp.global <- c(.8, .15, 0)
142
 
143
 
144
    ## Bruges dette?
37 pdel 145
##    .BDPars$xlabLine <- 0.9
146
##    .BDPars$ylabLine <- 1.1
5 pdel 147
 
148
### Histograms.
149
    ## If you really want to play with this, the barplot may be more flexible.
7 pdel 150
    ## The default color of the bars in a histogram and in barplot. NULL is default for both (white for histogram, grey for barplot). See col in ?histogram.
5 pdel 151
    .BDPars$hcol <- NULL
152
    ## Color of the borders of the bars 
153
    .BDPars$border <- .BDPars$col
56 pdel 154
    .BDPars$freq <- NULL
5 pdel 155
 
156
    ## A color map. This could be implemented for lattice/trellis plots?
157
    ## should at least be implemented as standard in image.plot
158
    ## .BDPars$color.palette <- colorRampPalette(c("#4d2a00","#eee7a7"))
159
    .BDPars$color.palette <- colorRampPalette(c("#3c1900","#fef7b7")) 
160
    .BDPars$color.palette2 <- colorRampPalette(c("#3c1900","#ffffff"))
161
    .BDPars$colpal.heat <- colorRampPalette(c("#ff0000","#0000ff"))
162
    ## the matlab red-green-blue
163
    .BDPars$colpal.ml <- colorRampPalette(c("#ff0000","#00ff00","#0000ff"))
164
  ## white-yellow-red
165
  ## may be good for the screen, but white and yellow are too close for paper.
166
  .BDPars$colpal.wyr <- colorRampPalette(c("#ffffff",7,"#ff0000"))
167
  ## white-green-red
168
  .BDPars$colpal.wgr <- colorRampPalette(c("#ffffff","#00ff00","#ff0000"))
169
  ## may be good for the screen, but white and yellow are too close for paper.
170
  ## you have a favourite?
171
    .BDPars$colpal <- .BDPars$colpal.wgr
172
 
173
### the first of these is only needed if using jpeg() in bdopen(). But that doesn't work...
29 pdel 174
    .BDPars$jpeg.quality <- 100
5 pdel 175
    .BDPars$jpeg.res <- 400
32 pdel 176
 
177
### debugging mode (gives terminal outputs)
178
    .BDPars$debug <- FALSE
179
 
58 pdel 180
    return(.BDPars)
5 pdel 181
  }