<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font style="font-size:10pt;" color="#366092" face="Arial" size="2">Hola Steven<font style="font-size: 10pt;" size="2"> y Salvador<font style="font-size: 10pt;" size="2">, y todos los usuarios de la lista<font style="font-size: 10pt;" size="2">:<br><br><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"></font>So<font style="font-size: 10pt;" size="2">y <font style="font-size: 10pt;" size="2">nuevo por aqui enviando consultas a la l<font style="font-size: 10pt;" size="2">ista </font>y en general en el<font style="font-size: 10pt;" size="2"> mundo de la programacion en C++. Despues de probar <font style="font-size: 10pt;" size="2">varios ejemplo<font style="font-size: 10pt;" size="2">s en C++ durante<font style="font-size: 10pt;" size="2"> un tiempo, y le<font style="font-size: 10pt;" size="2">ido casi todo el <font style="font-size: 10pt;" size="2">excelente cur<font style="font-size: 10pt;" size="2">so que<font style="font-size: 10pt;" size="2"> </font>tienen</font></font></font>, he<font style="font-size: 10pt;" size="2"> comenzado a <font style="font-size: 10pt;" size="2">buscar la manera<font style="font-size: 10pt;" size="2"> de <font style="font-size: 10pt;" size="2">plotear mis resu<font style="font-size: 10pt;" size="2">ltados. </font></font></font></font></font></font></font></font></font></font></font></font><font style="font-size: 10pt;" size="2">Generalmente siempre he<font style="font-size: 10pt;" size="2"> usado shell y herramientas en linux para hacer mis calculos pero ahora lo estoy <font style="font-size: 10pt;" size="2">haciendo<font style="font-size: 10pt;" size="2"> con</font></font> C++. Empe<font style="font-size: 10pt;" size="2">ze con consol<font style="font-size: 10pt;" size="2">as </font><font style="font-size: 10pt;" size="2">win32</font></font> </font></font>pero tb estoy probando<font style="font-size: 10pt;" size="2"> con window forms.<font style="font-size: 10pt;" size="2"><br><br>Sobre el pr<font style="font-size: 10pt;" size="2">imer<font style="font-size: 10pt;" size="2">o tengo una duda que quizas me puedan a ayudar a enten<font style="font-size: 10pt;" size="2">der, dado que despues de varias semanas buscando en <font style="font-size: 10pt;" size="2">google no he<font style="font-size: 10pt;" size="2"> encontrado nada real<font style="font-size: 10pt;" size="2">mente claro. <font style="font-size: 10pt;" size="2">Lo que quiero es plotear datos X-<font style="font-size: 10pt;" size="2">Y despues <font style="font-size: 10pt;" size="2">de que mi programa termin<font style="font-size: 10pt;" size="2">e</font> de funci<font style="font-size: 10pt;" size="2">onar. Por ejemp<font style="font-size: 10pt;" size="2">lo, tengo este programa:</font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font><br id="FontBreak"><pre style="" class="lang-c prettyprint prettyprinted"><code><span class="com">#include</span><span class="pln"> </span><span class="str"><iostream></span><span class="pln">
</span><span class="com">#include</span><span class="pln"> </span><span class="str"><cmath></span><span class="pln">
</span><span class="com">#include</span><span class="pln"> </span><span class="str"><iomanip></span><span class="pln">

</span><span class="kwd">using</span><span class="pln"> </span><span class="kwd">namespace</span><span class="pln"> std</span><span class="pun">;</span><span class="pln">

</span><span class="kwd">double</span><span class="pln"> f</span><span class="pun">(</span><span class="kwd">const</span><span class="pln"> </span><span class="kwd">double</span><span class="pln"> </span><span class="pun">&</span><span class="pln">x</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
    </span><span class="kwd">return</span><span class="pln"> </span><span class="pun">(</span><span class="pln">
        sin</span><span class="pun">(</span><span class="pln">x</span><span class="pun">)*</span><span class="pln">exp</span><span class="pun">(-</span><span class="pln">x</span><span class="pun">));</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="typ">int</span><span class="pln"> main</span><span class="pun">()</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    </span><span class="kwd">unsigned</span><span class="pln"> </span><span class="typ">Nplot</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="lit">100</span><span class="pun">;</span><span class="pln">
    </span><span class="kwd">double</span><span class="pln"> x_low </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0.0</span><span class="pun">;</span><span class="pln">
    </span><span class="kwd">double</span><span class="pln"> x_high </span><span class="pun">=</span><span class="pln"> </span><span class="lit">20.0</span><span class="pun">;</span><span class="pln">
    </span><span class="kwd">double</span><span class="pln"> h </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="pln">x_high </span><span class="pun">-</span><span class="pln"> x_low</span><span class="pun">)/(</span><span class="kwd">double</span><span class="pun">)</span><span class="typ">Nplot</span><span class="pun">;</span><span class="pln">

    </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">unsigned</span><span class="pln"> i</span><span class="pun">=</span><span class="lit">0</span><span class="pun">;</span><span class="pln">i</span><span class="pun"><=</span><span class="typ">Nplot</span><span class="pun">;</span><span class="pln">i</span><span class="pun">++)</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        </span><span class="kwd">double</span><span class="pln"> x </span><span class="pun">=</span><span class="pln"> x_low </span><span class="pun">+</span><span class="pln"> i</span><span class="pun">*</span><span class="pln">h</span><span class="pun">;</span><span class="pln">
        cout </span><span class="pun"><<</span><span class="pln"> setw</span><span class="pun">(</span><span class="lit">20</span><span class="pun">)</span><span class="pln"> </span><span class="pun"><<</span><span class="pln"> x </span><span class="pun"><<</span><span class="pln">
                setw</span><span class="pun">(</span><span class="lit">20</span><span class="pun">)</span><span class="pln"> </span><span class="pun"><<</span><span class="pln"> f</span><span class="pun">(</span><span class="pln">x</span><span class="pun">)</span><span class="pln"> </span><span class="pun"><<</span><span class="pln"> endl</span><span class="pun">;</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">

    system</span><span class="pun">(</span><span class="str">"pause>nul"</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">return</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span></code></pre><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><font style="font-size: 10pt;" size="2">y quiero<font style="font-size: 10pt;" size="2"> que despues que d<font style="font-size: 10pt;" size="2">e</font> los resultados<font style="font-size: 10pt;" size="2">, esto es las do<font style="font-size: 10pt;" size="2">s co<font style="font-size: 10pt;" size="2">lumnas<font style="font-size: 10pt;" size="2"> "<font style="font-size: 10pt;" size="2">x" y "f(x)", aparezca un grafico p<font style="font-size: 10pt;" size="2">lo<font style="font-size: 10pt;" size="2">teando <font style="font-size: 10pt;" size="2">la<font style="font-size: 10pt;" size="2"> linea, como la figura adjunta. No quiero nada adornado, s<font style="font-size: 10pt;" size="2">olo<font style="font-size: 10pt;" size="2"> un grafico simple <font style="font-size: 10pt;" size="2">donde aparez<font style="font-size: 10pt;" size="2">ca la<font style="font-size: 10pt;" size="2"> linea.<font style="font-size: 10pt;" size="2"> Mi pregunta es <font style="font-size: 10pt;" size="2">s<font style="font-size: 10pt;" size="2">i se puede adicionar codigo al codigo <font style="font-size: 10pt;" size="2">de arriba para que genere <font style="font-size: 10pt;" size="2">ese grafico<font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2">. En linux, <font style="font-size: 10pt;" size="2">yo corro el codigo de arriba con: c<font style="font-size: 10pt;" size="2">++</font> sin.cpp -o sin.exe<font style="font-size: 10pt;" size="2">.</font></font></font> Mi idea es <font style="font-size: 10pt;" size="2">que<font style="font-size: 10pt;" size="2"> al tener sin.cpp compilado (ie. sin.<font style="font-size: 10pt;" size="2">exe) </font>con el co<font style="font-size: 10pt;" size="2">digo<font style="font-size: 10pt;" size="2"> para <font style="font-size: 10pt;" size="2">plotear el X-Y</font>, pueda correr ese archivo en cualquier p<font style="font-size: 10pt;" size="2">c <font style="font-size: 10pt;" size="2">con linux<font style="font-size: 10pt;" size="2">. Se que puedo poner ese codigo en <font style="font-size: 10pt;" size="2">visual </font><font style="font-size: 10pt;" size="2">C++ y hacer un link a excel para plotear <font style="font-size: 10pt;" size="2">los resultad<font style="font-size: 10pt;" size="2">os, asi<font style="font-size: 10pt;" size="2"> como utilizar librerias externas al <font style="font-size: 10pt;" size="2">VC++, pero mi idea es que ese EXE no dep<font style="font-size: 10pt;" size="2">enda de eso.<font style="font-size: 10pt;" size="2"><br><br><font style="font-size: 10pt;" size="2">Tocando el mismo tema, pero yen<font style="font-size: 10pt;" size="2">do a<font style="font-size: 10pt;" size="2"> lo<font style="font-size: 10pt;" size="2"> que es windows form (que<font style="font-size: 10pt;" size="2"> probablement<font style="font-size: 10pt;" size="2">e estoy s<font style="font-size: 10pt;" size="2">ie<font style="font-size: 10pt;" size="2">ndo un poco "<font style="font-size: 10pt;" size="2">a<font style="font-size: 10pt;" size="2">nti C++" con esto ya que esos indi<font style="font-size: 10pt;" size="2">vidu<font style="font-size: 10pt;" size="2">os traba<font style="font-size: 10pt;" size="2">jan con C++/C<font style="font-size: 10pt;" size="2">LR), se <font style="font-size: 10pt;" size="2">que se pued<font style="font-size: 10pt;" size="2">e utilizar MSchart (que es un "plugin<font style="font-size: 10pt;" size="2">") </font>para graficar, pero he leido que esto genera u<font style="font-size: 10pt;" size="2">n prob<font style="font-size: 10pt;" size="2">lema al compilar y pasar el EXE <font style="font-size: 10pt;" size="2">entre pcs si es que no se tiene el .NET Framewok respectivo<font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"> (x lo que entiendo es <font style="font-size: 10pt;" size="2">q<font style="font-size: 10pt;" size="2">ue ese <font style="font-size: 10pt;" size="2">msc<font style="font-size: 10pt;" size="2">hart no <font style="font-size: 10pt;" size="2">forma parte del EXE<font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2">)</font>, sa<font style="font-size: 10pt;" size="2">ben si </font></font></font></font></font></font></font></font><font style="font-size: 10pt;" size="2">eso es cor<font style="font-size: 10pt;" size="2">re<font style="font-size: 10pt;" size="2">cto?<br><br><font style="font-size: 10pt;" size="2">Finalmente (disculpen por el l<font style="font-size: 10pt;" size="2">argo correo), se que consolas win32 es simple que e<font style="font-size: 10pt;" size="2">l AP<font style="font-size: 10pt;" size="2">I </font></font>win<font style="font-size: 10pt;" size="2">32<font style="font-size: 10pt;" size="2">, he<font style="font-size: 10pt;" size="2"> "hoj<font style="font-size: 10pt;" size="2">eado" <font style="font-size: 10pt;" size="2">el<font style="font-size: 10pt;" size="2"> curso<font style="font-size: 10pt;" size="2"> que tienen</font> de este ultimo (ya que son mas de 2000 paginas<font style="font-size: 10pt;" size="2">!), y no he podi<font style="font-size: 10pt;" size="2">do bajar <font style="font-size: 10pt;" size="2">los<font style="font-size: 10pt;" size="2"> ejemplos que tienen ya que ocurre u<font style="font-size: 10pt;" size="2">n problema, pero qu<font style="font-size: 10pt;" size="2">i<font style="font-size: 10pt;" size="2">siera sa<font style="font-size: 10pt;" size="2">ber si en <font style="font-size: 10pt;" size="2">el caso no se pueda hacer lo<font style="font-size: 10pt;" size="2">s graficos <font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2">X-<font style="font-size: 10pt;" size="2">Y </font></font>con consola win32 de la forma que quiero, est<font style="font-size: 10pt;" size="2">o se podria hacer con el <font style="font-size: 10pt;" size="2">API win32.<br><br><font style="font-size: 10pt;" size="2">Desde ya<font style="font-size: 10pt;" size="2"> muchas <font style="font-size: 10pt;" size="2">gracias por <font style="font-size: 10pt;" size="2">su atencio<font style="font-size: 10pt;" size="2">n y leer mi consulta,<br><br><font style="font-size: 10pt;" size="2">Saludos co<font style="font-size: 10pt;" size="2">rdiales,<br><br><font style="font-size: 10pt;" size="2">G<font style="font-size: 10pt;" size="2">ery<br><br></font></font></font></font></font></font></font></font></font></font></font> </font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font><br></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font>__________________________________________________________________________________________<br>Piensa en el medio ambie<font style="" face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie es NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br>                                          </div></body>
</html>