How to Swap the Horizontal and Vertical Axes in Julia
Overview
This article introduces a method to swap the horizontal and vertical axes in Julia.
Code
By using permute = (:y, :x)
as an argument in the plot
function, you can change the order of the axes.
bar(name, height)
bar(name, height, permute = (:y, :x))
Full Code
using Plots
name = ["Gaeul", "Yujin", "Rei", "Wonyoung", "Liz", "Leeseo"]
height = [164, 173, 170, 173, 171, 165]
bar(name, height)
bar(name, height, permute = (:y, :x))
Environment
- OS: Windows
- Julia: v1.10.0