pgf-tikz / pgfplots

pgfplots - A TeX package to draw normal and/or logarithmic plots directly in TeX in two and three dimensions with a user-friendly interface and pgfplotstable - a TeX package to round and format numerical tables. Examples in manuals and/or on web site.
http://pgfplots.sourceforge.net/
200 stars 35 forks source link

Plot of z(t)=abs(x(t)+iy(t)) from file containing (t,x,y) . #255

Closed pgf-tikz-bot closed 4 years ago

pgf-tikz-bot commented 13 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/21/ Author: *anonymous Timestamp: 2011-07-22 06:14:01

Hi,

I know that I can plot y(x) from a text file containing the two columns (x,y).

What I need, and don't know how to do, is to plot z(t), e.g. z(t)=abs(x(t)+iy(t)), from a text file containing the three columns (t,x,y) . I attached a date.txt file as an example.

How can it be done?

Thank you in advance best regards

Enrico Toniolo

pgf-tikz-bot commented 13 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/21/#7bb0 Author: nobody Timestamp: 2011-07-22 06:14:06

https://sourceforge.net/p/pgfplots/feature-requests/_discuss/thread/ee913657/7bb0/attachment/data.txt text data file containing columns (t,x,y)

pgf-tikz-bot commented 13 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/21/#4fc2 Author: nobody Timestamp: 2011-07-25 07:56:06

\documentclass{article} % \usepackage{pgfplots} \usepackage{pgfplotstable}

\usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}

\begin{document}

\def\PlotRL#1#2 { \addplot[thick,smooth,#2] table [ x expr={\thisrowno{0}*1e-6}, y expr= {10*ln(\thisrowno{1}*\thisrowno{1}+\thisrowno{2}*\thisrowno{2})/ln(10)} ] {#1}; }

\pgfplotstableread{data1.txt}\dataA \pgfplotstableread{data2.txt}\dataB

\begin{tikzpicture} \begin{axis} \PlotRL{\dataA}{red} \PlotRL{\dataB}{blue} \end{axis} \end{tikzpicture} \end{document}

pgf-tikz-bot commented 11 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/21/#ce3b Author: cfeuersaenger Timestamp: 2013-06-21 21:17:18.503000

pgf-tikz-bot commented 11 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/21/#a00c Author: cfeuersaenger Timestamp: 2013-06-21 21:17:18.955000

I am a little bit confused of what you mean by the logs in your listing...?

Don't you mean the operation

z(t) = sqrt(x(t)^2 + y(t)^2)

which can be implemented using

sqrt(\thisrowno{1}\thisrowno{1}+\thisrowno{2}\thisrowno{2})

?

I am sorry that I answer that later. Somehow, I miss tickets on sourceforge from time to time :-(

I assume that my suggestion fixes the issue and I will close the ticket. Feel free to answer such usage issues on some forum or the mailing list; these have higher visibility than sourceforge tickets.

pgf-tikz-bot commented 7 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/feature-requests/21/#71e8 Author: cfeuersaenger Timestamp: 2017-03-25 06:40:01.065000