how to print variable value of draw function












2














I use this function:



documentclass{standalone}
usepackage{tikz}
usepackage{pgfplots}
pgfplotsset{compat=1.15}

begin{document}
newcommand{xmax}{14}
newcommand{fmin}{(pi/3)}
newcommand{fmax}{(2*pi)}
begin{tikzpicture}
[domain=xmax:0, samples=500]


% The following line uses linear frequency increase
%draw[ultra thick, red] plot (x, {sin(deg((fmin+x*((fmax-fmin))/xmax)*x))} );
% The following line uses exponential frequency increase
draw[ultra thick, red] plot (x, {sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))} );
end{tikzpicture}
end{document}


I need to evaluate the x parameter.
How can I print it's value?
also on log file is ok



Renato










share|improve this question
























  • Please don't post just code fragments. Make a minimal working example (MWE) that also includes how all the variables are defined.
    – samcarter
    Dec 19 '18 at 10:14
















2














I use this function:



documentclass{standalone}
usepackage{tikz}
usepackage{pgfplots}
pgfplotsset{compat=1.15}

begin{document}
newcommand{xmax}{14}
newcommand{fmin}{(pi/3)}
newcommand{fmax}{(2*pi)}
begin{tikzpicture}
[domain=xmax:0, samples=500]


% The following line uses linear frequency increase
%draw[ultra thick, red] plot (x, {sin(deg((fmin+x*((fmax-fmin))/xmax)*x))} );
% The following line uses exponential frequency increase
draw[ultra thick, red] plot (x, {sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))} );
end{tikzpicture}
end{document}


I need to evaluate the x parameter.
How can I print it's value?
also on log file is ok



Renato










share|improve this question
























  • Please don't post just code fragments. Make a minimal working example (MWE) that also includes how all the variables are defined.
    – samcarter
    Dec 19 '18 at 10:14














2












2








2


1





I use this function:



documentclass{standalone}
usepackage{tikz}
usepackage{pgfplots}
pgfplotsset{compat=1.15}

begin{document}
newcommand{xmax}{14}
newcommand{fmin}{(pi/3)}
newcommand{fmax}{(2*pi)}
begin{tikzpicture}
[domain=xmax:0, samples=500]


% The following line uses linear frequency increase
%draw[ultra thick, red] plot (x, {sin(deg((fmin+x*((fmax-fmin))/xmax)*x))} );
% The following line uses exponential frequency increase
draw[ultra thick, red] plot (x, {sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))} );
end{tikzpicture}
end{document}


I need to evaluate the x parameter.
How can I print it's value?
also on log file is ok



Renato










share|improve this question















I use this function:



documentclass{standalone}
usepackage{tikz}
usepackage{pgfplots}
pgfplotsset{compat=1.15}

begin{document}
newcommand{xmax}{14}
newcommand{fmin}{(pi/3)}
newcommand{fmax}{(2*pi)}
begin{tikzpicture}
[domain=xmax:0, samples=500]


% The following line uses linear frequency increase
%draw[ultra thick, red] plot (x, {sin(deg((fmin+x*((fmax-fmin))/xmax)*x))} );
% The following line uses exponential frequency increase
draw[ultra thick, red] plot (x, {sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))} );
end{tikzpicture}
end{document}


I need to evaluate the x parameter.
How can I print it's value?
also on log file is ok



Renato







tikz-pgf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 19 '18 at 10:22

























asked Dec 19 '18 at 9:54









RenatoP

32829




32829












  • Please don't post just code fragments. Make a minimal working example (MWE) that also includes how all the variables are defined.
    – samcarter
    Dec 19 '18 at 10:14


















  • Please don't post just code fragments. Make a minimal working example (MWE) that also includes how all the variables are defined.
    – samcarter
    Dec 19 '18 at 10:14
















Please don't post just code fragments. Make a minimal working example (MWE) that also includes how all the variables are defined.
– samcarter
Dec 19 '18 at 10:14




Please don't post just code fragments. Make a minimal working example (MWE) that also includes how all the variables are defined.
– samcarter
Dec 19 '18 at 10:14










2 Answers
2






active

oldest

votes


















4














To print all the points that the draw...plot is using, you can:



documentclass{article}
usepackage{tikz}
usepackage{pgfplots}
pgfplotsset{compat=1.15}

begin{document}
newcommand{xmax}{14}
newcommand{fmin}{(pi/3)}
newcommand{fmax}{(2*pi)}
begin{tikzpicture}
[domain=xmax:0, samples=500]
draw[ultra thick, red] plot (x, {sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))} );
end{tikzpicture}

pgfmathsetmacro{step}{xmax/500}
foreach x in {0,step,...,xmax} {
x, qquad
pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult
par
}

end{document}


output



(continuing...)



If you want the output on the log file, you can add (after the par, for example)



 wlog{x is xspace and the function pgfmathresult} 


and you'll have in your .log file:



x is 0 and the function 0.0
x is 0.028 and the function 0.02939
x is 0.056 and the function 0.05899
x is 0.084 and the function 0.08878
x is 0.112 and the function 0.11867


For the strange space, see Space after command with write



Clearly, to have it only on the log file, use as the loop:



foreach x in {0,step,...,xmax} { 
pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}
wlog{x is xspace and the function pgfmathresult}
}





share|improve this answer































    2














    You don't give us much information in your question, so I'm just using some dummy numbers....



    documentclass{article}

    usepackage{tikz}


    begin{document}

    defx{0.5}
    defxmax{1}
    deffmin{1}
    deffmax{5}


    pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult


    end{document}





    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "85"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466502%2fhow-to-print-variable-value-of-draw-function%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      4














      To print all the points that the draw...plot is using, you can:



      documentclass{article}
      usepackage{tikz}
      usepackage{pgfplots}
      pgfplotsset{compat=1.15}

      begin{document}
      newcommand{xmax}{14}
      newcommand{fmin}{(pi/3)}
      newcommand{fmax}{(2*pi)}
      begin{tikzpicture}
      [domain=xmax:0, samples=500]
      draw[ultra thick, red] plot (x, {sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))} );
      end{tikzpicture}

      pgfmathsetmacro{step}{xmax/500}
      foreach x in {0,step,...,xmax} {
      x, qquad
      pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult
      par
      }

      end{document}


      output



      (continuing...)



      If you want the output on the log file, you can add (after the par, for example)



       wlog{x is xspace and the function pgfmathresult} 


      and you'll have in your .log file:



      x is 0 and the function 0.0
      x is 0.028 and the function 0.02939
      x is 0.056 and the function 0.05899
      x is 0.084 and the function 0.08878
      x is 0.112 and the function 0.11867


      For the strange space, see Space after command with write



      Clearly, to have it only on the log file, use as the loop:



      foreach x in {0,step,...,xmax} { 
      pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}
      wlog{x is xspace and the function pgfmathresult}
      }





      share|improve this answer




























        4














        To print all the points that the draw...plot is using, you can:



        documentclass{article}
        usepackage{tikz}
        usepackage{pgfplots}
        pgfplotsset{compat=1.15}

        begin{document}
        newcommand{xmax}{14}
        newcommand{fmin}{(pi/3)}
        newcommand{fmax}{(2*pi)}
        begin{tikzpicture}
        [domain=xmax:0, samples=500]
        draw[ultra thick, red] plot (x, {sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))} );
        end{tikzpicture}

        pgfmathsetmacro{step}{xmax/500}
        foreach x in {0,step,...,xmax} {
        x, qquad
        pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult
        par
        }

        end{document}


        output



        (continuing...)



        If you want the output on the log file, you can add (after the par, for example)



         wlog{x is xspace and the function pgfmathresult} 


        and you'll have in your .log file:



        x is 0 and the function 0.0
        x is 0.028 and the function 0.02939
        x is 0.056 and the function 0.05899
        x is 0.084 and the function 0.08878
        x is 0.112 and the function 0.11867


        For the strange space, see Space after command with write



        Clearly, to have it only on the log file, use as the loop:



        foreach x in {0,step,...,xmax} { 
        pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}
        wlog{x is xspace and the function pgfmathresult}
        }





        share|improve this answer


























          4












          4








          4






          To print all the points that the draw...plot is using, you can:



          documentclass{article}
          usepackage{tikz}
          usepackage{pgfplots}
          pgfplotsset{compat=1.15}

          begin{document}
          newcommand{xmax}{14}
          newcommand{fmin}{(pi/3)}
          newcommand{fmax}{(2*pi)}
          begin{tikzpicture}
          [domain=xmax:0, samples=500]
          draw[ultra thick, red] plot (x, {sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))} );
          end{tikzpicture}

          pgfmathsetmacro{step}{xmax/500}
          foreach x in {0,step,...,xmax} {
          x, qquad
          pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult
          par
          }

          end{document}


          output



          (continuing...)



          If you want the output on the log file, you can add (after the par, for example)



           wlog{x is xspace and the function pgfmathresult} 


          and you'll have in your .log file:



          x is 0 and the function 0.0
          x is 0.028 and the function 0.02939
          x is 0.056 and the function 0.05899
          x is 0.084 and the function 0.08878
          x is 0.112 and the function 0.11867


          For the strange space, see Space after command with write



          Clearly, to have it only on the log file, use as the loop:



          foreach x in {0,step,...,xmax} { 
          pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}
          wlog{x is xspace and the function pgfmathresult}
          }





          share|improve this answer














          To print all the points that the draw...plot is using, you can:



          documentclass{article}
          usepackage{tikz}
          usepackage{pgfplots}
          pgfplotsset{compat=1.15}

          begin{document}
          newcommand{xmax}{14}
          newcommand{fmin}{(pi/3)}
          newcommand{fmax}{(2*pi)}
          begin{tikzpicture}
          [domain=xmax:0, samples=500]
          draw[ultra thick, red] plot (x, {sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))} );
          end{tikzpicture}

          pgfmathsetmacro{step}{xmax/500}
          foreach x in {0,step,...,xmax} {
          x, qquad
          pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult
          par
          }

          end{document}


          output



          (continuing...)



          If you want the output on the log file, you can add (after the par, for example)



           wlog{x is xspace and the function pgfmathresult} 


          and you'll have in your .log file:



          x is 0 and the function 0.0
          x is 0.028 and the function 0.02939
          x is 0.056 and the function 0.05899
          x is 0.084 and the function 0.08878
          x is 0.112 and the function 0.11867


          For the strange space, see Space after command with write



          Clearly, to have it only on the log file, use as the loop:



          foreach x in {0,step,...,xmax} { 
          pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}
          wlog{x is xspace and the function pgfmathresult}
          }






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 19 '18 at 11:04

























          answered Dec 19 '18 at 10:39









          Rmano

          7,75221647




          7,75221647























              2














              You don't give us much information in your question, so I'm just using some dummy numbers....



              documentclass{article}

              usepackage{tikz}


              begin{document}

              defx{0.5}
              defxmax{1}
              deffmin{1}
              deffmax{5}


              pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult


              end{document}





              share|improve this answer


























                2














                You don't give us much information in your question, so I'm just using some dummy numbers....



                documentclass{article}

                usepackage{tikz}


                begin{document}

                defx{0.5}
                defxmax{1}
                deffmin{1}
                deffmax{5}


                pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult


                end{document}





                share|improve this answer
























                  2












                  2








                  2






                  You don't give us much information in your question, so I'm just using some dummy numbers....



                  documentclass{article}

                  usepackage{tikz}


                  begin{document}

                  defx{0.5}
                  defxmax{1}
                  deffmin{1}
                  deffmax{5}


                  pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult


                  end{document}





                  share|improve this answer












                  You don't give us much information in your question, so I'm just using some dummy numbers....



                  documentclass{article}

                  usepackage{tikz}


                  begin{document}

                  defx{0.5}
                  defxmax{1}
                  deffmin{1}
                  deffmax{5}


                  pgfmathparse{sin(deg(exp(ln(fmin)+x/xmax*(ln(fmax)-ln(fmin)))*x))}pgfmathresult


                  end{document}






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 19 '18 at 10:18









                  samcarter

                  85.8k794275




                  85.8k794275






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466502%2fhow-to-print-variable-value-of-draw-function%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Morgemoulin

                      Scott Moir

                      Souastre