Graphics, Figures & Tables ⇒ Trashed psellipticarc when arrows too large
Trashed psellipticarc when arrows too large
I'm experiencing an issue whose best fix I don't know: I'm drawing angles (in pstricks) with psellipticarc, using an end arrow for showing the direction of the angle. It works beautifully, except when the angle is small, so the arrow doesn't fit within the angle, and then the result is that the whole 2*PI circle is drawn, instead of the wished arc (if I don't draw the arrow, the arc is fine no matter if it's small or not).
One (perhaps dirty) quick solution would be to avoid drawing an arrow when the arc is too small, but... how can I determine the threshold for choosing whether to generate the arrow or not? I guess it depends on the arc angle, the arc radius, and surely a lot of other factors I ignore.
Note that I'd be happy if the problem was just the arrow overriding the arc length: it would be a very slight artifact. However, the fact that the arc gets trashed, drawing the whole 2*PI circle is what really stops the show for me.
Thank you for any advice you could give!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Trashed psellipticarc when arrows too large
I did not experience that issue yet. Without code the question is still quite theoretical. Perhaps post a

Stefan
Trashed psellipticarc when arrows too large
Code: Select all
\psellipticarc[linewidth=0.100000000000mm,arrowinset=0]{->}(1.473134185720cm,5.267092621231cm)(0.133333333333cm,0.133333333333cm){0.000000}{15.945396}
So, while such command could be tuned by hand so that the arrow fits, I need some way of doing it automatically, because the C program generates arcs of arbitrary size.
Another thing is that I could use psarc instead of psellipticarc, but I'm using the later because I sometimes need different scales in the X and Y axes.
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Trashed psellipticarc when arrows too large
Perhaps another one makes this. So, I recommend to give TikZ a try instead of PSTricks.
Stefan
Trashed psellipticarc when arrows too large
Yes, I can provide a full working example. Try this one (compile it with latex, dvips, and ps2pdf). In the output you can see four 90 degree angles which are correctly drawn. However, on the top you can see two complete circles which are wrong. They should be arcs of 15.94 degrees, but the arrows don't fit in them, so pstricks draws the full circle, which is what I don't want:Stefan_K wrote:I would have tested it, but that's not possible with a single command. I don't type a dozen lines with document class, packages, pspicture environment etc. for each question I read.
Perhaps another one makes this.
Code: Select all
\documentclass[a4paper,11pt,fleqn]{article}\usepackage{amssymb,amsmath,mathtools}\usepackage{pstricks,pst-node}\usepackage{graphicx}\begin{document}\begin{figure}[H]\centering\begin{pspicture}(9.777777777778cm,8.111111111111cm)\psellipticarc[linewidth=0.100000000000mm,arrowinset=0]{->}(2.535555555556cm,1.488888888889cm)(0.133333333333cm,0.133333333333cm){0.000000}{90.000000}\psellipticarc[linewidth=0.100000000000mm,arrowinset=0]{->}(7.202222222222cm,1.488888888889cm)(0.133333333333cm,0.133333333333cm){0.000000}{90.000000}\psellipticarc[linewidth=0.100000000000mm,arrowinset=0]{->}(2.535555555556cm,3.822222222222cm)(0.133333333333cm,0.133333333333cm){0.000000}{90.000000}\psellipticarc[linewidth=0.100000000000mm,arrowinset=0]{->}(7.202222222222cm,3.822222222222cm)(0.133333333333cm,0.133333333333cm){0.000000}{90.000000}\psellipticarc[linewidth=0.100000000000mm,arrowinset=0]{->}(1.473134185720cm,5.267092621231cm)(0.133333333333cm,0.133333333333cm){0.000000}{15.945396}\psellipticarc[linewidth=0.100000000000mm,arrowinset=0]{->}(2.806467519035cm,5.648045001948cm)(0.133333333333cm,0.133333333333cm){0.000000}{15.945396}\end{pspicture}\end{figure}\end{document}
Too late. My tool is based on pstricks since quite a few years ago. Changing to another command set would be overkill.Stefan_K wrote:So, I recommend to give TikZ a try instead of PSTricks.
Re: Trashed psellipticarc when arrows too large
Trashed psellipticarc when arrows too large
Can this be done in pstricks? How?
FIXED: I finally got an acceptable result by using psclip/endpsclip, with a triangle as the clipping region. The triangle covers the arc, with some additional space, for accounting for the arrow width. It would be preferable that pstricks wouldn't draw arrows when they're going to trash an arc, but this workaround provides a result which satisfies me.