Message Boards Message Boards

1
|
5032 Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

[Solved] How to rotate FrameTicks by 90 Degree?

Posted 4 years ago

Hello,

Please can you help?

How to rotate the "FrameTicks" by 90 Degree?

fakedata = {8, 1, 7, 61, 38, 0, 2, 0, 11, 10, 2, 0, 4, 26, 26, 3, 1, 
   1, 74, 52, 0, 0, 0, 3, 16};

ListPlot[Tooltip[fakedata]
 , Filling -> Axis
 , ImageSize -> 600
 , AspectRatio -> 1/3
 , Frame -> True
 , FrameTicksStyle -> Directive[Black, 10]
 , FrameTicks -> {{Automatic, Automatic}
   , {{{1, "0->0"}, {2, "0->1"}, {3, "0->2"}, {4, "0->3"}, {5, "0->4"}
     , {6, "1->0"}, {7, "1->1"}, {8, "1->2"}, {9, "1->3"}, {10, "1->4"}
     , {11, "2->0"}, {12, "2->1"}, {13, "2->2"}, {14, "2->3"}, {15, 
      "2->4"}
     , {16, "3->0"}, {17, "3->1"}, {18, "3->2"}, {19, "3->3"}, {20, 
      "3->4"}
     , {21, "4->0"}, {22, "4->1"}, {23, "4->2"}, {24, "4->3"}, {25, 
      "4->4"}
     }, Automatic}}
 ]

enter image description here

Best Regards and Thanks,....Jos

POSTED BY: Jos Klaps
2 Replies

Hello Rohit,

Thanks for your quick reply and help. The code works perfectly now !

Best Regards,....Jos

POSTED BY: Jos Klaps
Posted 4 years ago

Hi Jos,

One way to do this

tickValues={{1,"0->0"},{2,"0->1"},{3,"0->2"},{4,"0->3"},
  {5,"0->4"},{6,"1->0"},{7,"1->1"},{8,"1->2"},{9,"1->3"},
  {10,"1->4"},{11,"2->0"},{12,"2->1"},{13,"2->2"},{14,"2->3"},
  {15,"2->4"},{16,"3->0"},{17,"3->1"},{18,"3->2"},{19,"3->3"},
  {20,"3->4"},{21,"4->0"},{22,"4->1"},{23,"4->2"},{24,"4->3"},{25,"4->4"}};

ticks = MapAt[Rotate[#, Pi/2] &, tickValues, {All, -1}];

ListPlot[Tooltip[fakedata],
 Filling -> Axis,
 ImageSize -> 600,
 AspectRatio -> 1/3,
 Frame -> True,
 FrameTicksStyle -> Directive[Black, 10],
 FrameTicks -> {{Automatic, Automatic}, {ticks, Automatic}}]

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract