Skip to content

Commit 3befb5c

Browse files
committed
Added commands for plotting
Including greek letters, subscripts, etc.
1 parent b9a6c19 commit 3befb5c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

CodeTricks.md

+36
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,39 @@ A demonstration [here](http://dirk.eddelbuettel.com/blog/2011/04/12/) shows that
7777
* check memory use by `x` using `object.size(x)`
7878
* use `memory.profile()`
7979
* use `mem.limits()` to get/set memory limits
80+
81+
## Plotting for publication (From Scott)
82+
83+
Labels in R can be annoying to figure out. Here are some code bits that may help?
84+
85+
Label the value of a parameter (m) used in the plot.
86+
87+
```R
88+
eval(paste("m = ", m))
89+
```
90+
91+
Label the value of VLE used in plot, which is part of a list of objects in a3 (and called g in that list)
92+
LE is subscript to V with V[LE] (superscript is ^)
93+
94+
```R
95+
substitute(paste(V[LE],"=",g),a3)
96+
```
97+
98+
Use italics in a label
99+
100+
```R
101+
expression(paste("Strength of stabilizing selection ", italic(s)))
102+
```
103+
104+
Use math symbols (see ?plotmath).
105+
With i subscript [i]
106+
107+
```R
108+
expression(paste("Local adaptation ",bar(L)[i]))
109+
```
110+
111+
With many subscripts and with greek letters
112+
113+
```R
114+
expression(paste("Mean phenotype ",bar(mu)[i][,][z]))
115+
```

0 commit comments

Comments
 (0)