Search code examples
plotplotlyjuliaheatmap

heatmap in Julia : why is there a transpose between the terminal and the IDE?


I'm unsure why the heatmap outputed by the following minimal working example

using Plots

plotlyjs()

List_x = [1, 2, 3]
List_y = [1, 2]
List_f = [0 0 0; 1 2 3]

my_plot = heatmap(List_x, List_y, List_f,
                    xlabel = "x axis", ylabel = "y_axis")

display(my_plot)

readline()

depends on whether I run the code from my IDE (either VSCode or Atom), or from the terminal with

>>> julia MWE.jl

In the IDE case, I get

Figure produced by the MWE if run from IDE

And in the terminal case I get

Figure produced by the MWE if run from terminal

As you can see, there is a transpose between the two cases. I would like to always have the IDE behavior, can I do something about it?


Solution

  • This behavior was due to a bug reported in https://github.com/JuliaPlots/Plots.jl/issues/3940, fixed in https://github.com/JuliaPlots/Plots.jl/pull/3953, and released in Plots.jl v1.24.2. On the most recent version, the REPL (terminal) plot now looks like:

    test figure on REPL