0

Have very simple 2D graph, couple of lines, some axis, title

x = [1, 2, 3]
y1 = [3,5,4]
y2 = [4,3,5]
plt.plot(x, y1, 'g-')
plt.plot(x, y2, 'b.')
plt.title('Super')

plt.show()

Could I with simple command rotate whole graph? Around the center if possible?

Severin Pappadeux
  • 18,636
  • 3
  • 38
  • 64
  • Check the documentation https://matplotlib.org/stable/api/transformations.html – Srikanth May 17 '22 at 03:01
  • 1
    Do you mean something like this? https://i.stack.imgur.com/Gv2gd.png – tdy May 17 '22 at 04:36
  • 1
    If so, you can use floating axes with an Affine2D transform: https://stackoverflow.com/q/21652631/13138364 – tdy May 17 '22 at 04:43
  • @tdy I would be grateful if you could code for the image in the answer, and I'll accept it. THank you – Severin Pappadeux May 19 '22 at 13:38
  • @SeverinPappadeux Actually it turns out this isn't quite correct. I just noticed the rotated `x` and `y` locations are not correct (e.g., `x` is supposed to be at `[1,2,3]`). I'll try to dig around some more. – tdy May 20 '22 at 03:27

0 Answers0