I want to plot a indifference curve through a node (b) using gnuplot and tikz. The relevant (though non-functional) part from my plot is

        \p1 = (b)
        plot[domain=1:10] function{exp(log(\x1)-log(x)+log(\y1))};

Essentially, I want to access the x and y coordinate of point (b) separately, and use them in the function specification. The reason why it currently doesn't work is because the let function saves the coordinates in the latex pt unit, while the plot function plots according to my coordinate system.

I've tried many things, including computing the conversion myself using veclen, but that function returns the same unit as the input, and didn't get me any further. Surely there is something simple that I'm missing?

  • 1
    Could you please post a complete MWE? It wouldn't be bad if you could post a picture (with a external program or hand-drawn) how the output should look, too. – current_user Aug 28 '18 at 17:58
  • 2
    \draw let \p1 = (b),\n1={\y1*1cm/1pt},\n2={\x1*1cm/1pt} in plot[domain=1:10] function{exp(log(\n2)-log(x)+log(\n1))}; for your technical question or exploit the logarithm laws, log(\x1)-log(\y1)=\log(\x1/\y1) to see that the units cancel... – user121799 Aug 28 '18 at 18:24
  • 1
    Isn't just exp(log(\x1)-log(x)+log(\y1)) = \x1/x*\y1? – Henri Menke Aug 28 '18 at 23:18
  • @HenriMenke I agree with you but because of the usual sledge hammer concerns I hesitate to close the question because it is "unclear what you are asking" – user121799 Aug 29 '18 at 2:27
  • @marmot The gold badge sledge hammer only enables you to single-handedly close as duplicate. All other close votes still go through review. – Henri Menke Aug 29 '18 at 2:29

Browse other questions tagged or ask your own question.