<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Multi serie plot</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for mp.s"><tr><td>mp.s</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Multi serie plot</h2>

<h3>Description</h3>

<p>mp.s make a plot with one or more series.
The object parameter require a ggplot object (Look at the examples).
</p>


<h3>Usage</h3>

<pre>
mp.s(
  object,
  xaxis,
  yaxis,
  ybreaks = 10,
  percent = FALSE,
  yaccuracy = 0.01,
  ydecimalmark = ".",
  title = "Title",
  xlab = "X axis",
  ylab = "Y axis",
  stitle = NULL,
  note = NULL,
  ctitles = "black",
  cscales = ctitles,
  cbgrid = "white",
  clgrid = cbgrid,
  cplot = "white",
  cticks = "black",
  pnote = 1,
  cbord = cplot,
  titlesize = 20,
  wordssize = 12,
  snote = 11,
  xlim = NULL
)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>object</code></td>
<td>
<p>a ggplot graphic object</p>
</td></tr>
<tr valign="top"><td><code>xaxis</code></td>
<td>
<p>x axis of one of your graphics</p>
</td></tr>
<tr valign="top"><td><code>yaxis</code></td>
<td>
<p>y axis of one of your graphics</p>
</td></tr>
<tr valign="top"><td><code>ybreaks</code></td>
<td>
<p>number of y axis breaks (default=10)</p>
</td></tr>
<tr valign="top"><td><code>percent</code></td>
<td>
<p>If TRUE y axis in percent (default=F)</p>
</td></tr>
<tr valign="top"><td><code>yaccuracy</code></td>
<td>
<p>a round for y axis (default=0.01)</p>
</td></tr>
<tr valign="top"><td><code>ydecimalmark</code></td>
<td>
<p>y decimal mark (default=&quot;.&quot;)</p>
</td></tr>
<tr valign="top"><td><code>title</code></td>
<td>
<p>title of plot</p>
</td></tr>
<tr valign="top"><td><code>xlab</code></td>
<td>
<p>x axis label</p>
</td></tr>
<tr valign="top"><td><code>ylab</code></td>
<td>
<p>y axis label</p>
</td></tr>
<tr valign="top"><td><code>stitle</code></td>
<td>
<p>subtitle</p>
</td></tr>
<tr valign="top"><td><code>note</code></td>
<td>
<p>note</p>
</td></tr>
<tr valign="top"><td><code>ctitles</code></td>
<td>
<p>color of titles (title,xlab,ylab)</p>
</td></tr>
<tr valign="top"><td><code>cscales</code></td>
<td>
<p>color of the scales (default= same ctitles)</p>
</td></tr>
<tr valign="top"><td><code>cbgrid</code></td>
<td>
<p>color of grid background</p>
</td></tr>
<tr valign="top"><td><code>clgrid</code></td>
<td>
<p>color of grid lines</p>
</td></tr>
<tr valign="top"><td><code>cplot</code></td>
<td>
<p>color of plot background</p>
</td></tr>
<tr valign="top"><td><code>cticks</code></td>
<td>
<p>color of axis ticks</p>
</td></tr>
<tr valign="top"><td><code>pnote</code></td>
<td>
<p>position of note (default=1) (only numbers)</p>
</td></tr>
<tr valign="top"><td><code>cbord</code></td>
<td>
<p>color of plot border (default= same cplot)</p>
</td></tr>
<tr valign="top"><td><code>titlesize</code></td>
<td>
<p>size of title (default=20) (only numbers)</p>
</td></tr>
<tr valign="top"><td><code>wordssize</code></td>
<td>
<p>size of words (default=12) (only numbers)</p>
</td></tr>
<tr valign="top"><td><code>snote</code></td>
<td>
<p>size of note (default=11) (only numbers)</p>
</td></tr>
<tr valign="top"><td><code>xlim</code></td>
<td>
<p>limit of x axis (default=NULL)</p>
</td></tr>
</table>


<h3>Value</h3>

<p>Return a graphic.
</p>


<h3>Examples</h3>

<pre>
v=data.frame("x"=c('a','b','c','d','e'),"y"=c(5,3,7,10,9),"y2"=c(7,2,5,8,7))

g= ggplot2::ggplot()+ggplot2::geom_line(mapping=ggplot2::aes(x=v$x,y=v$y,group=1),lwd=2)+
ggplot2::geom_line(mapping=ggplot2::aes(x=v$x,y=v$y2,group=1),color='blue',lwd=2)

mp.s(object=g,xaxis=v$x,yaxis=v$y,title="Simple example")

mp.s(g,v$x,v$y,percent=TRUE,title="Example with percent data",xlab=NULL,ylab=NULL)

mp.s(g,v$x,v$y,percent=TRUE,yaccuracy=1,title="y accuracy set",xlab=NULL,ylab=NULL)

g= ggplot2::ggplot()+ggplot2::geom_area(mapping=ggplot2::aes(x=v$x,y=v$y),
fill='red',lwd=2,group=1)+
ggplot2::geom_area(mapping=ggplot2::aes(x=v$x,y=v$y2),fill='blue',lwd=2,group=1)

mp.s(g,v$x,v$y,title="Example with area plot")

v=data.frame("x"=c('a','b','c','d','e'),"y"=c(5,-3,-6,10,7))

g= ggplot2::ggplot()+ggplot2::geom_col(ggplot2::aes(x=v$x,y=v$y,group=1),
fill=p.colorbypositive(v$y),color='black',lwd=1)+
ggplot2::geom_line(ggplot2::aes(x=v$x,y=v$y,group=1),color='black',lwd=1)

mp.s(g,v$x,v$y,title="Example with colorbypositive",xlab=NULL,ylab=NULL)

</pre>


</body></html>
