Subversion Repositories bdplot

Rev

Rev 12 | Rev 26 | 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.
9 pdel 13
    .BDPars$figdir <- ""
5 pdel 14
    ## Choose paper size for automatic figure sizing. Only "b5" implemented
15
    .BDPars$paper <- "a4.word"
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
 
32
    ## Nice to put to something default you (almost) always use x
33
    ## and y labels and you want to substitute them with psfrag
34
    ## anyway.
35
    .BDPars$xlab <- "longxlabel"
36
    .BDPars$ylab <- "longylabel"
37
 
38
    .BDPars$toplab <- NA
39
    .BDPars$rightlab <- NA        
40
 
41
    ## You probably don't want a default here. 
42
    .BDPars$xlim <- NULL
43
    .BDPars$ylim <- NULL
44
 
45
    .BDPars$draw.xaxis <- TRUE
46
    .BDPars$draw.yaxis <- TRUE
12 pdel 47
    .BDPars$draw.raxis <- FALSE
5 pdel 48
 
49
    .BDPars$grid <- FALSE
50
    .BDPars$grid.lwd <- 0.3
51
    ## what are these? NA/TRUE/"Def"? 
52
    .BDPars$grid.h <- NA
53
    .BDPars$grid.v <- NA
54
 
55
    .BDPars$grid.col <- "grey50"
56
 
57
 
58
    ## controls - at least - size of point characters
59
    .BDPars$cex.plot <- 0.4
60
 
61
    ## See ?par
62
    .BDPars$cex.main <- .7
63
    ##
64
    ## This has no effect on the axis label sizes if they are
65
    ## substituted with psfrag.
66
    .BDPars$cex.lab <- .6
67
    ## font size on the axis indexing
68
    .BDPars$cex.axis <- .5
69
    ## line width
70
    .BDPars$lwd <- 0.5
71
    ## length of tick marks. positive values put the ticks inside the
72
    ## plots.
73
    .BDPars$tcl <- -.2
74
 
75
    ## cex for legends. Legends are not written by pbp. But you
76
    ## may want to save your default anyway. It's used by bd.legend()
15 pdel 77
    .BDPars$cex.legend <- .6
5 pdel 78
    ## a default position
79
    .BDPars$pos.legend <- "topright"
80
    ## And a default background color: Is NA transparancy?
81
    ## This is not a background for the whole frame, it is for shapes.
82
    .BDPars$bg.legend <- "white"
83
 
84
    ## col controls the color of the plot.
85
    .BDPars$col <- "black"
86
 
87
    ## box around the plot.
88
    .BDPars$bty <- "o"
89
 
90
    ## the default plotting character for points
91
    .BDPars$pch <- 21
92
 
93
### Margins
94
    ## It may be tempting to omit a top margin or make it very small
95
    ## when there is no top label. But remember that sometimes numbers
96
    ## on the x axis exceed the plot region. If you make it very small,
97
    ## remember to check that for each plot, you may have to do some
98
    ## exceptions then.
99
 
100
    ##c(bottom, left, top, right)
101
    .BDPars$mar.nolab <- c(1.5, 1, 0.4, 0.3)
12 pdel 102
    .BDPars$mar.lab <-  c(2.1, 2.1, 2.1, 2.1)
5 pdel 103
    ## This one can not be set with commands since it is used in this
104
    ## function.
105
    mar.lab.half <- c(2.1, 1.9, 1.9, 1.9)
106
    ##c(2,  2, 1.5, 1.35)
107
 
108
 
109
    ## What exactly do these do?
110
    ## some control of distances from axis to text?
111
    ## mgp for axis commands.
112
    ## Only used if .BDPars$draw.xaxis=TRUE
113
    ## (?,,)
114
    .BDPars$mgp.xaxis <- c(1, -.1, 0)
115
    ## Only used if .BDPars$draw.yaxis=TRUE
116
    .BDPars$mgp.yaxis <- c(1, 0.15, 0)
12 pdel 117
    .BDPars$mgp.raxis <- c(1.2, 0.15, 0)
5 pdel 118
    ## This (only first element?) has effect if axis labels are written
119
    ## by the plot command. It can also be written by the mtext
120
    ## command. Only one of these methods should be used in the
121
    ## future. I think the mtext way is more flexible, but then the
122
    ## distance should be calculated from the mgp.axis in stead of from
123
    ## the ?labLine. If not, these use different units which is
124
    ## confusing.
125
    ## (plotbox to labs, axis to axislabs,plotbox to axis)
126
    .BDPars$mgp.global <- c(.8, .15, 0)
127
 
128
 
129
    ## Bruges dette?
130
    .BDPars$xlabLine <- 0.9
131
    .BDPars$ylabLine <- 1.1
132
 
133
### Histograms.
134
    ## If you really want to play with this, the barplot may be more flexible.
7 pdel 135
    ## 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 136
    .BDPars$hcol <- NULL
137
    ## Color of the borders of the bars 
138
    .BDPars$border <- .BDPars$col
139
 
140
    ## A color map. This could be implemented for lattice/trellis plots?
141
    ## should at least be implemented as standard in image.plot
142
    ## .BDPars$color.palette <- colorRampPalette(c("#4d2a00","#eee7a7"))
143
    .BDPars$color.palette <- colorRampPalette(c("#3c1900","#fef7b7")) 
144
    .BDPars$color.palette2 <- colorRampPalette(c("#3c1900","#ffffff"))
145
    .BDPars$colpal.heat <- colorRampPalette(c("#ff0000","#0000ff"))
146
    ## the matlab red-green-blue
147
    .BDPars$colpal.ml <- colorRampPalette(c("#ff0000","#00ff00","#0000ff"))
148
  ## white-yellow-red
149
  ## may be good for the screen, but white and yellow are too close for paper.
150
  .BDPars$colpal.wyr <- colorRampPalette(c("#ffffff",7,"#ff0000"))
151
  ## white-green-red
152
  .BDPars$colpal.wgr <- colorRampPalette(c("#ffffff","#00ff00","#ff0000"))
153
  ## may be good for the screen, but white and yellow are too close for paper.
154
  ## you have a favourite?
155
    .BDPars$colpal <- .BDPars$colpal.wgr
156
 
157
### the first of these is only needed if using jpeg() in bdopen(). But that doesn't work...
158
    .BDPars$jpeg.quality <- 100  
159
    .BDPars$jpeg.res <- 400
160
 
161
    .BDPars
162
  }