<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
<div>Boa noite,</div><div><br></div><div>Infelizmente não pude testar seu exemplo pois você não apresentou um exemplo reproduzível com um banco de dados já presente no R, porém encontrei dois links que podem te ajudar com esse problema:</div><div><br></div><div><a href="https://www.r-bloggers.com/one-r-tip-a-day-how-to-draw-a-plot-with-two-y-axises-and-one-x-axis/ " class="enhancr_card_0714521754">https://www.r-bloggers.com/one-r-tip-a-day-how-to-draw-a-plot-with-two-y-axises-and-one-x-axis/ </a><br><div><br></div><div><a href="https://stackoverflow.com/questions/6142944/how-can-i-plot-with-2-different-y-axes" class="enhancr_card_1004583971">How can I plot with 2 different y-axes?</a><br><div><br></div><div>Caso ainda não consiga mesmo com esses links, posso verificar de novo a questão com um exemplo reproduzível.</div><div><br></div><div>att,</div><div>Rodrigo<br></div></div><div><br></div><div id="ydpfab4750cenhancr_card_1004583971" class="ydpfab4750cyahoo-link-enhancr-card ydpfab4750cymail-preserve-class ydpfab4750cymail-preserve-style" style="max-width: 400px; font-family: Helvetica, Arial, sans-serif;" data-url="https://stackoverflow.com/questions/6142944/how-can-i-plot-with-2-different-y-axes" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://stackoverflow.com/questions/6142944/how-can-i-plot-with-2-different-y-axes" style="text-decoration:none !important;color:#000 !important;" class="ydpfab4750cyahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table class="ydpfab4750ccard-wrapper ydpfab4750cyahoo-ignore-table" style="max-width:400px;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td width="400"><table class="ydpfab4750ccard ydpfab4750cyahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px;" width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="ydpfab4750ccard-primary-image-cell" style="background-image: url("https://s.yimg.com/lo/api/res/1.2/1wUG32ibNb9ItOe48vjFFw--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded.cf.jpg"); background-color: rgb(0, 0, 0); background-repeat: no-repeat; background-size: cover; position: relative; border-radius: 2px 2px 0px 0px; min-height: 175px;" valign="top" height="175" bgcolor="#000000" background="https://s.yimg.com/lo/api/res/1.2/1wUG32ibNb9ItOe48vjFFw--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded.cf.jpg"><!--[if gte mso 9]><v:rect fill="true" stroke="false" style="width:396px;height:175px;position:absolute;top:0;left:0;"><v:fill type="frame" color="#000000" src="https://s.yimg.com/lo/api/res/1.2/1wUG32ibNb9ItOe48vjFFw--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded.cf.jpg"/></v:rect><![endif]--><table class="ydpfab4750ccard-overlay-container-table ydpfab4750cyahoo-ignore-table" style="width:100%;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="ydpfab4750ccard-overlay-cell" style="background-image: url("https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png"); background-color: transparent; border-radius: 2px 2px 0px 0px; min-height: 175px;" valign="top" bgcolor="transparent" background="https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png"><!--[if gte mso 9]><v:rect fill="true" stroke="false" style="width:396px;height:175px;position:absolute;top:-18px;left:0;"><v:fill type="pattern" color="#000000" src="https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png"/><v:textbox inset="0,0,20px,0"><![endif]--><table class="ydpfab4750cyahoo-ignore-table" style="width: 100%; min-height: 175px;" height="175" border="0"><tbody><tr><td class="ydpfab4750ccard-richInfo2" style="text-align:left;padding:15px 0 0 15px;vertical-align:top;"></td><td class="ydpfab4750ccard-actions" style="text-align:right;padding:15px 15px 0 0;vertical-align:top;"><div class="ydpfab4750ccard-share-container"></div></td></tr></tbody></table><!--[if gte mso 9]></v:textbox></v:rect><![endif]--></td></tr></tbody></table></td></tr><tr><td><table class="ydpfab4750ccard-info ydpfab4750cyahoo-ignore-table" style="background-color: rgb(255, 255, 255); background-repeat: repeat; background-attachment: scroll; background-image: none; background-size: auto auto; position: relative; z-index: 2; width: 100%; max-width: 400px; border-radius: 0px 0px 2px 2px; border-top: 1px solid rgb(224, 228, 233);" border="0" align="center" cellspacing="0" cellpadding="0"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px;"></td><td style="vertical-align: middle; padding: 12px 24px 16px 12px; width: 99%; font-family: Helvetica, Arial, sans-serif; border-radius: 0px 0px 2px;"><h2 class="ydpfab4750ccard-title" style="font-size: 14px; line-height: 19px; margin: 0px 0px 6px; font-family: Helvetica, Arial, sans-serif; color: rgb(38, 40, 42);">How can I plot with 2 different y-axes?</h2><p class="ydpfab4750ccard-description" style="font-size:12px;line-height:16px;margin:0px;color:#979ba7;word-break:break-word;">I would <g class="gr_ gr_152 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="152" data-gr-id="152">like</g> superimpose two scatter plots in R so that each set of points has its own (different) y-axis (i.e.,...</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br></div><div><br></div></div><div><br></div><div id="ydpa2acd8d3enhancr_card_0714521754" class="ydpa2acd8d3yahoo-link-enhancr-card ydpa2acd8d3yahoo-link-enhancr-not-allow-cover ydpa2acd8d3ymail-preserve-class ydpa2acd8d3ymail-preserve-style" style="max-width: 400px; font-family: Helvetica, Arial, sans-serif;" data-url="https://www.r-bloggers.com/one-r-tip-a-day-how-to-draw-a-plot-with-two-y-axises-and-one-x-axis/" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://www.r-bloggers.com/one-r-tip-a-day-how-to-draw-a-plot-with-two-y-axises-and-one-x-axis/" style="text-decoration:none !important;color:#000 !important;" class="ydpa2acd8d3yahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table class="ydpa2acd8d3card-wrapper ydpa2acd8d3yahoo-ignore-table" style="max-width:400px;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td width="400"><table class="ydpa2acd8d3card ydpa2acd8d3yahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px;" width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td><table class="ydpa2acd8d3card-info ydpa2acd8d3yahoo-ignore-table" style="background-color: rgb(255, 255, 255); background-repeat: repeat; background-attachment: scroll; background-image: none; background-size: auto auto; position: relative; z-index: 2; width: 100%; max-width: 400px; border-radius: 0px 0px 2px 2px; border-top: 1px solid rgb(224, 228, 233);" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px;"></td><td style="vertical-align: middle; padding: 12px 24px 16px 12px; width: 99%; font-family: Helvetica, Arial, sans-serif; border-radius: 0px 0px 2px;"><h2 class="ydpa2acd8d3card-title" style="font-size: 14px; line-height: 19px; margin: 0px 0px 6px; font-family: Helvetica, Arial, sans-serif; color: rgb(38, 40, 42);">One R Tip A Day: How to draw a plot with two Y <g class="gr_ gr_139 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="139" data-gr-id="139">axises</g> and one <g class="gr_ gr_136 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="136" data-gr-id="136">X axis</g></h2><p class="ydpa2acd8d3card-description" style="font-size:12px;line-height:16px;margin:0px;color:#979ba7;word-break:break-word;">One R Tip A Day: How to draw a plot with two Y axises and one X <g class="gr_ gr_137 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="137" data-gr-id="137">axisplot</g>(1:10)par("<g class="gr_ gr_138 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="138" data-gr-id="138">usr</g>")# [1] 0.64 10.36 0.64 10...</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br></div><div><br></div><div><br></div>
<div id="yahoo_quoted_1197041736" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
Em quinta-feira, 8 de março de 2018 19:20:49 BRT, Ary Serpa Neto via R-br <r-br@listas.c3sl.ufpr.br> escreveu:
</div>
<div><br></div>
<div><br></div>
<div><div id="yiv4995921644"><div><br>
<div>Ola,</div>
<div> </div>
<div>Estou tentando construir um calibration plot como o da figura em anexo. Basicamente, ele une a curva de calibração com um gráfico de barras com a quantidade de observações por "bin". Alguem sabe uma maneira fácil de fazer isso?</div>
<div> </div>
<div>Para o calibration plot eu ja construi com dois "packages" diferentes mas em nenhum consegui colocar as observações. Os códigos que usei foram:</div>
<div> </div>
<div>require(gbm)</div>
<div>calibrate.plot(Database$Event, Database$Predicted)</div>
<div> </div>
<div>#ou#</div>
<div> </div>
<div>require(caret)</div>
<div>Plot<-calibration(as.factor(Event!=1)~Predicted, data=Database)</div>
<div>plot(Plot)</div>
<div> </div>
<div>Desde já agradeço a atenção</div>
</div>
<div>
<p>Ary Serpa Neto, MD, MSc, PhD<br> Hospital Israelita Albert Einstein, São Paulo, Brazil (http://www.einstein.br): Department of Critical Care Medicine & Jewish Institute of Education and Research Albert Einstein (http://www.einstein.br/pesquisa)<br> The PROtective VEntilation NETwork (www.provenet.eu)<br> Associate Editor: BMC Anesthesiology and BMC Pulmonary Medicine<br> http://publicationslist.org/a.serpa_neto<br> http://lattes.cnpq.br/0254664157557375</p>
</div></div>_______________________________________________<br>R-br mailing list<br><a ymailto="mailto:R-br@listas.c3sl.ufpr.br" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br><a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forne�a c�digo m�nimo reproduz�vel.</div>
</div>
</div></div></body></html>