<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><br><div><div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="padding-left: 5px; margin: 5px 0px 5px 5px; border-left: 2px solid rgb(16, 16, 255); font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma">----- Mensagem encaminhada ----<br><b><span style="font-weight: bold;">De:</span></b> Paulo Justiniano Ribeiro Jr <paulojus@c3sl.ufpr.br><br><b><span style="font-weight: bold;">Para:</span></b> R_STAT@yahoogrupos.com.br<br><b><span style="font-weight: bold;">Enviadas:</span></b> Segunda-feira, 19 de Janeiro de 2009 12:12:56<br><b><span style="font-weight: bold;">Assunto:</span></b> Re: [R_STAT] Gráfico com dois eixos y<br></font><br>
<!--~-|**|PrettyHtmlStartT|**|-~-->
<div id="ygrp-mlmsg" style="width: 655px;">
<div id="ygrp-msg" style="width: 470px; margin: 0pt; padding: 0pt 25px 0pt 0pt; float: left;">
<!--~-|**|PrettyHtmlEndT|**|-~-->
<div id="ygrp-text">
<p>Caro Henrique e Vinicius<br>
<br>
Imagino que o que o Vinicuis quer é um pouco diferente do proposto pelo<br>
Henrique onde possam ser colocados no mesmo gráfico<br>
dias variávies de ordem de grandezas diferentes, e portanto o simples uso<br>
de ylim nao seria suficiente.<br>
<br>
Nao sei se tem algo automatizado para isto encapsulado em alguma função do<br>
R.<br>
Mas para fazer passo a passo a ideia de solução neste caso seria:<br>
<br>
1. fazer o gráfico da 1a<br>
2. fazer um reescalonamento da segunda via uma interpolação linear da<br>
segunda dentro da faixa de variação da primeira<br>
3. adicionar esta segunda reencalonada ao gráfico<br>
4. adicionar o eixo do outro lado na escala original.<br>
<br>
Um exemplo implementando estes passos:<br>
<br>
x <- 1:20<br>
x1 <- rnorm(20)<br>
x2 <- rpois(20, lam=50)<br>
<br>
plot(x, x1, type="l", axes=F, frame=T)<br>
axis(1)<br>
axis(2, at=seq(-2,2, by=1))<br>
<br>
x2.n <- min(x1) + (diff(range( x1))/diff( range(x2) )) * (x2-min(x2))<br>
lines(x, x2.n, col=2)<br>
x2.l <- min(x2) + (diff(range( x2))/diff( range(x1) )) * (seq(-2,2,by= 1) -<br>
min(x2))<br>
axis(4, at=seq(-2,2, by=1), labels = round(x2.l, dig=1))<br>
<br>
Paulo Justiniano Ribeiro Jr<br>
LEG (Laboratorio de Estatistica e Geoinformacao)<br>
Universidade Federal do Parana<br>
Caixa Postal 19.081<br>
CEP 81.531-990<br>
Curitiba, PR - Brasil<br>
Tel: (+55) 41 3361 3573<br>
Fax: (+55) 41 3361 3141<br>
e-mail: paulojus AT ufpr br<br>
<a rel="nofollow" target="_blank" href="http://www.leg.ufpr.br/%7Epaulojus">http://www.leg. ufpr.br/~ paulojus</a><br>
<br>
On Mon, 19 Jan 2009, Henrique Dallazuanna wrote:<br>
<br>
> Tente assim:<br>
><br>
> par(mar = c(5, 4, 3, 4))<br>
> plot(1:10, rnorm(10), type = 'l', ylim = c(1, 20))<br>
> lines(11:20, col = 'red')<br>
> axis(4)<br>
> mtext(text = "Segundo Eixo Y", 4, line = 3)<br>
><br>
> 2009/1/19 Vinicius Brito Rocha <<a rel="nofollow" ymailto="mailto:viniciusbritor%40hotmail.com" target="_blank" href="mailto:viniciusbritor%40hotmail.com">viniciusbritor@ hotmail.com</a>><br>
><br>
> > Srs.<br>
> ><br>
> > quero plotar informações com diferentes escalas em um mesmo gráfico, queria<br>
> > usar um recurso semelhante ao do excel, onde um eixo y fica do lado direito<br>
> > e o outro do lado esquerdo.<br>
> ><br>
> ><br>
> ><br>
> > Vinicius Brito Rocha.<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > ------------ --------- ---------<br>
> > É fácil compartilhar suas fotos com o Windows LiveT Arraste e solte<<a rel="nofollow" target="_blank" href="http://www.microsoft.com/windows/windowslive/photos.aspx">http://www.microsof t.com/windows/ windowslive/ photos.aspx</a>><br>
> ><br>
> ><br>
><br>
><br>
><br>
> --<br>
> Henrique Dallazuanna<br>
> Curitiba-Paraná -Brasil<br>
> 25° 25' 40" S 49° 16' 22" O<br>
><br>
</p>
</div>
<!--~-|**|PrettyHtmlStart|**|-~-->
<span style="color: white;">__._,_.___</span>
<div id="ygrp-actbar">
<span class="left">
<a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/message/5338;_ylc=X3oDMTM1NDd0ajQ0BF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRtc2dJZAM1MzQzBHNlYwNmdHIEc2xrA3Z0cGMEc3RpbWUDMTIzMjM3NDM4MgR0cGNJZAM1MzM4">
Mensagens neste tópico </a> (<span class="bld">3</span>)
</span>
<a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/post;_ylc=X3oDMTJxZzNrdjVzBF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRtc2dJZAM1MzQzBHNlYwNmdHIEc2xrA3JwbHkEc3RpbWUDMTIzMjM3NDM4Mg--?act=reply&messageNum=5343">
<span class="bld">
Responder </span> (através da web)
</a> |
<a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/post;_ylc=X3oDMTJmb2NhajdzBF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNudHBjBHN0aW1lAzEyMzIzNzQzODI-" class="bld">
Adicionar um novo tópico </a>
</div>
<div id="ygrp-vitnav">
<a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/messages;_ylc=X3oDMTJmMWl2cXRuBF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNtc2dzBHN0aW1lAzEyMzIzNzQzODI-">Mensagens</a>
| <a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/files;_ylc=X3oDMTJnNHJkb2tyBF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNmaWxlcwRzdGltZQMxMjMyMzc0Mzgy">Arquivos</a>
| <a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/photos;_ylc=X3oDMTJmbGU4NTBpBF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNwaG90BHN0aW1lAzEyMzIzNzQzODI-">Fotos</a>
| <a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/links;_ylc=X3oDMTJnZWFna2k2BF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNsaW5rcwRzdGltZQMxMjMyMzc0Mzgy">Links</a>
| <a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/database;_ylc=X3oDMTJkanFsYmU5BF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNkYgRzdGltZQMxMjMyMzc0Mzgy">Banco de dados</a>
| <a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/polls;_ylc=X3oDMTJnOHIzaTNrBF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNwb2xscwRzdGltZQMxMjMyMzc0Mzgy">Enquetes</a>
</div>
<div id="ygrp-grft">
</div>
<div id="ygrp-ft">
<a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/;_ylc=X3oDMTJldGM2a3Y2BF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTIzMjM3NDM4Mg--">
<img src="http://us.i1.yimg.com/us.yimg.com/i/br/groups/groups-brazil_1.gif" alt="Yahoo! Grupos" height="19" width="108" border="0"></a> <br>
<a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/join;_ylc=X3oDMTJnZHV0OW1sBF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNzdG5ncwRzdGltZQMxMjMyMzc0Mzgy">Alterar configurações via web</a> (Requer Yahoo! ID) <br>
Alterar configurações via e-mail: <a rel="nofollow" ymailto="mailto:R_STAT-digest@yahoogrupos.com.br?subject= Recebimento de e-mail: Lista de mensagens" target="_blank" href="mailto:R_STAT-digest@yahoogrupos.com.br?subject=%20Recebimento%20de%20e-mail:%20Lista%20de%20mensagens">Alterar recebimento para lista diária de mensagens</a> | <a rel="nofollow" ymailto="mailto:R_STAT-traditional@yahoogrupos.com.br?subject=Alterar formato de distribuição: Tradicional" target="_blank" href="mailto:R_STAT-traditional@yahoogrupos.com.br?subject=Alterar%20formato%20de%20distribui%C3%A7%C3%A3o:%20Tradicional">Alterar formato para o tradicional</a> <br>
<a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT;_ylc=X3oDMTJlc3Q0dnNvBF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDZnRyBHNsawNocGYEc3RpbWUDMTIzMjM3NDM4Mg--">
Visite seu Grupo
</a> |
<a rel="nofollow" target="_blank" href="http://br.yahoo.com/info/utos.html">
Termos de uso do Yahoo! Grupos </a> |
<a rel="nofollow" ymailto="mailto:R_STAT-unsubscribe@yahoogrupos.com.br?subject=" target="_blank" href="mailto:R_STAT-unsubscribe@yahoogrupos.com.br?subject=">
Sair do grupo </a>
</div>
</div>
<div id="ygrp-sponsor" style="width: 160px; float: right; clear: none; margin: 0pt 0pt 25px; background: none repeat scroll 0% 0% white;">
<div id="ygrp-reco">
</div>
<div id="ygrp-vital">
<div id="vithd">Atividade nos últimos dias</div>
<ul style="list-style-type: none; padding: 0pt; margin: 2px 0pt;">
<li style="clear: both;">
<div class="ct" style="float: right;"><span style="display: none;"> </span>3</div>
<div class="cat"><a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT/members;_ylc=X3oDMTJnMXZhdjI5BF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDdnRsBHNsawN2bWJycwRzdGltZQMxMjMyMzc0Mzgy">Novos usuários</a></div>
</li>
</ul>
<a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/group/R_STAT;_ylc=X3oDMTJmYmswamlxBF9TAzk3NDkwNDM3BGdycElkAzExOTIzMjc1BGdycHNwSWQDMjEzNzExMTYwNQRzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzEyMzIzNzQzODI-">
Visite seu Grupo </a>
</div>
<div id="nc">
<div class="ad">
<div id="hd1">Yahoo! Mail</div>
<p><a rel="nofollow" target="_blank" href="http://us.lrd.yahoo.com/_ylc=X3oDMTJtOGZ1M29mBF9TAzk3NDkwNDM3BF9wAzEEZ3JwSWQDMTE5MjMyNzUEZ3Jwc3BJZAMyMTM3MTExNjA1BHNlYwNuY21vZARzbGsDbWFpbARzdGltZQMxMjMyMzc0Mzgy;_ylg=1/SIG=10ujd6ds6/**http%3A//mail.yahoo.com.br/">Conecte-se ao mundo</a></p>
<p>Proteção anti-spam</p>
<p>Muito mais espaço</p>
</div>
<div class="ad">
<div id="hd1">Yahoo! Barra</div>
<p><a rel="nofollow" target="_blank" href="http://us.lrd.yahoo.com/_ylc=X3oDMTJwaThwdWpqBF9TAzk3NDkwNDM3BF9wAzIEZ3JwSWQDMTE5MjMyNzUEZ3Jwc3BJZAMyMTM3MTExNjA1BHNlYwNuY21vZARzbGsDdG9vbGJhcgRzdGltZQMxMjMyMzc0Mzgy;_ylg=1/SIG=111ngvtas/**http%3A//br.toolbar.yahoo.com/">Instale grátis</a></p>
<p>Buscar sites na web</p>
<p>Checar seus e-mails .</p>
</div>
<div class="ad">
<div id="hd1">Yahoo! Grupos</div>
<p><a rel="nofollow" target="_blank" href="http://br.groups.yahoo.com/;_ylc=X3oDMTJwNXVubjlkBF9TAzk3NDkwNDM3BF9wAzMEZ3JwSWQDMTE5MjMyNzUEZ3Jwc3BJZAMyMTM3MTExNjA1BHNlYwNuY21vZARzbGsDZ3JvdXBzMgRzdGltZQMxMjMyMzc0Mzgy">Crie seu próprio grupo</a></p>
<p>A melhor forma de comunicação</p>
<p></p>
</div>
</div>
</div>
<div style="clear: both; color: rgb(255, 255, 255); font-size: 1px;">.</div>
</div> <img src="http://geo.yahoo.com/serv?s=97490437/grpId=11923275/grpspId=2137111605/msgId=5343/stime=1232374382/nc1=1/nc2=2/nc3=3" height="1" width="1"> <br>
<span style="color: white;">__,_._,___</span>
<!--~-|**|PrettyHtmlEnd|**|-~-->
<!--~-|**|PrettyHtmlStart|**|-~-->
<style type="text/css">
<!--
#ygrp-mkp{
border:1px solid #d8d8d8;font-family:Arial;margin:14px 0px;padding:0px 14px;}
#ygrp-mkp hr{
border:1px solid #d8d8d8;}
#ygrp-mkp #hd{
color:#628c2a;font-size:85%;font-weight:bold;line-height:122%;margin:10px 0px;}
#ygrp-mkp #ads{
margin-bottom:10px;}
#ygrp-mkp .ad{
padding:0 0;}
#ygrp-mkp .ad a{
color:#0000ff;text-decoration:none;}
-->
</style>
<style type="text/css">
<!--
#ygrp-sponsor #ygrp-lc{
font-family:Arial;}
#ygrp-sponsor #ygrp-lc #hd{
margin:10px 0px;font-weight:bold;font-size:78%;line-height:122%;}
#ygrp-sponsor #ygrp-lc .ad{
margin-bottom:10px;padding:0 0;}
-->
</style>
<style type="text/css">
<!--
#ygrp-mlmsg {font-size:13px;font-family:arial, helvetica, clean, sans-serif;}
#ygrp-mlmsg table {font-size:inherit;font:100%;}
#ygrp-mlmsg select, input, textarea {font:99% arial, helvetica, clean, sans-serif;}
#ygrp-mlmsg pre, code {font:115% monospace;}
#ygrp-mlmsg * {line-height:1.22em;}
#ygrp-text{
font-family:Georgia;
}
#ygrp-text p{
margin:0 0 1em 0;}
#ygrp-tpmsgs{
font-family:Arial;
clear:both;}
#ygrp-vitnav{
padding-top:10px;font-family:Verdana;font-size:77%;margin:0;}
#ygrp-vitnav a{
padding:0 1px;}
#ygrp-actbar{
clear:both;margin:25px 0;white-space:nowrap;color:#666;text-align:right;}
#ygrp-actbar .left{
float:left;white-space:nowrap;}
.bld{font-weight:bold;}
#ygrp-grft{
font-family:Verdana;font-size:77%;padding:15px 0;}
#ygrp-ft{
font-family:verdana;font-size:77%;border-top:1px solid #666;
padding:5px 0;
}
#ygrp-mlmsg #logo{
padding-bottom:10px;}
#ygrp-reco {
margin-bottom:20px;padding:0px;}
#ygrp-reco #reco-head {
font-weight:bold;color:#ff7900;}
#reco-grpname{
font-weight:bold;margin-top:10px;}
#reco-category{
font-size:77%;}
#reco-desc{
font-size:77%;}
#ygrp-vital{
background-color:#e0ecee;margin-bottom:20px;padding:2px 0 8px 8px;}
#ygrp-vital #vithd{
font-size:77%;font-family:Verdana;font-weight:bold;color:#333;text-transform:uppercase;}
#ygrp-vital ul{
padding:0;margin:2px 0;}
#ygrp-vital ul li{
list-style-type:none;clear:both;border:1px solid #e0ecee;
}
#ygrp-vital ul li .ct{
font-weight:bold;color:#ff7900;float:right;width:2em;text-align:right;padding-right:.5em;}
#ygrp-vital ul li .cat{
font-weight:bold;}
#ygrp-vital a{
text-decoration:none;}
#ygrp-vital a:hover{
text-decoration:underline;}
#ygrp-sponsor #hd{
color:#999;font-size:77%;}
#ygrp-sponsor #ov{
padding:6px 13px;background-color:#e0ecee;margin-bottom:20px;}
#ygrp-sponsor #ov ul{
padding:0 0 0 8px;margin:0;}
#ygrp-sponsor #ov li{
list-style-type:square;padding:6px 0;font-size:77%;}
#ygrp-sponsor #ov li a{
text-decoration:none;font-size:130%;}
#ygrp-sponsor #nc{
background-color:#eee;margin-bottom:20px;padding:0 8px;}
#ygrp-sponsor .ad{
padding:8px 0;}
#ygrp-sponsor .ad #hd1{
font-family:Arial;font-weight:bold;color:#628c2a;font-size:100%;line-height:122%;}
#ygrp-sponsor .ad a{
text-decoration:none;}
#ygrp-sponsor .ad a:hover{
text-decoration:underline;}
#ygrp-sponsor .ad p{
margin:0;}
o{font-size:0;}
.MsoNormal{
margin:0 0 0 0;}
#ygrp-text tt{
font-size:120%;}
blockquote{margin:0 0 0 4px;}
.replbq{margin:4;}
-->
</style>
<!--~-|**|PrettyHtmlEnd|**|-~-->
</div></div></div>
</div><br>
</body></html>