Open pgf-tikz-bot opened 9 years ago
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/74/#acbd Author: cfeuersaenger Timestamp: 2015-01-21 19:59:15.085000
Thanks for the detailed report.
However, according to the (admittedly very brief) reference manual, the macro is defined as "The \pgfplotspointunitx is the pgf unit vector in x direction".
This excludes the scaling stuff. Which raises the question why is it exposed in the reference manual at all and what are its uses!?
I will think about a solution. It sounds, however, as if I should prefer a solution which allows to write +(0:1) directly... especially since I improved the interoperability between tikz and pgfplots in the last and current release.
To me, it sounds as if I could improve the manual regarding this basic level macro (perhaps mark it as "internal, handle with care") and fix the high level interface instead. Let me know if this is not what you want.
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/74/#f1c1 Author: cfeuersaenger Timestamp: 2015-01-21 20:53:20.219000
I have added support for +(0:1) directly - it will be evaluated with axis units.
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/74/#8cef Author: liverpool-luigi Timestamp: 2015-01-22 09:19:18.303000
Thank you for your feedback. It's true that those macros seem to be unuseful, but I'm telling you what I used them for. Suppose I have a coordinate system with two different unit lengths for the axes. I want to draw an arc between two lines by means of the arc instruction provided by TikZ. So I need to compute the angle between the two lines. I cannot use the two slopes directly, because the two units of measurement are different, so I have to scale them using the two unit vector lenghts. If I use the \pgfplotsunit[xy]macro as it is now, the result is incorrect because of the behaviour I told you in the first post. Finally, I think that in some rare cases those macro are useful and should be improved. For instance, I'd convert them in lenght macros.
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/74/#08b8 Author: liverpool-luigi Timestamp: 2015-01-22 22:27:27.962000
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/74/#acbd/c775 Author: liverpool-luigi Timestamp: 2015-01-22 22:28:52.733000
I've just had another look to the reference manual. Actually I missed the phrase "The $x_i$ are the \pgfplotspointunitx variants". So I agree with your questions about the exposition in the manual and uses. I thought that the name pgfplots-unit-x-length meant "the lenght of the pgfplots unit in the x direction", not the pgf one, for which I had used the name "pgf-unit-x-length" instead.
By the way, what about adding three new length macros for the pgfplots unit [xyz] lengths, or redefining the existing ones with the new meaning? I think it would be more useful.
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/74/#127d Author: cfeuersaenger Timestamp: 2017-03-18 09:35:49.655000
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/74/ Author: liverpool-luigi Timestamp: 2014-12-04 09:13:23.004000
According to this question, I found out that the \pgfplotsunit[xyz]length macros don't actually yield the unit vectors length as stated in the manual of the package. See the following example:
where the blue lines are as long as the actual unit vectors, the black lines are as long as \pgfplotsunitxlenght pt and \pgfplotsunitylength pt, and the red line is as long as TikZ x unit. You can see that \pgfplotsunitxlenght is not equal to pgfplots unit x length, but rather to TikZ unit x length (I would say that axis scaling is missing).
I think this depends on the fact that in the pgfplots.scaling.code.tex source code, on line 1826 and following, the \pgfplots@x@veclength macro is defined as the length of vector (\pgf@xx,\pgf@xy), which is TikZ x unit vector and not pgfplots one.
If you want the actual x unit vector length (in points), you have to do something like:
as in the following example: