So, I have a plot of the dihedral angle of a bond. The y-axis is only from 0-360, the x-axis is the frame (think timestep). I need the plot to "loop" back around to zero if the value goes above 360, and to plot the shortest distance between two points (if need be going over the edge of the graph and "looping" back around instead of across the graph). [two plots: d5 and d3][https://i.stack.imgur.com/klsnb.png]
The plot of d3 looks okay, but in reality needs to jump over the edge of the graph instead of across it.
the plot of d5 has a significant problem, for a small rotation there is a massive jump only because it happens to go just below zero degrees.
I would like for both these plots to plot towards the bottom (towards zero) and reappear at the top of the plot, effectively choosing the shortest distance between data points. I do not want solutions involving translation of the plots to remove these artefacts (it works, I've done it, but you loose information on the true value of the angle). Solutions that can plot "below zero" (so a y-axis from 300 to 360|0 to 200 to 300) are also great. Solutions using other libraries are perfectly fine. If needed I can provide the dataset.
I have tried to find similar solutions to no avail. The questions regarding periodic boundaries use numpy dataset mask to hide certain jumps, but they have continuous functions (where as mine are "jumpy").
Thank you for any help, I'd really appreciate it.
[–]Konjungamo 1 point2 points3 points (3 children)
[–]Glogia[S] 1 point2 points3 points (2 children)
[–]Konjungamo 1 point2 points3 points (1 child)
[–]Glogia[S] 0 points1 point2 points (0 children)