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

1

6

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?

Versus answered 10/11, 2021 at 10:25 Comment(3)
I posted the code in the REPL and it gives me the terminal outcome, which looks like the wrong one to me (x axis has 2 pixel values and y axis has 3 (miscropped) pixel values, but it should be the other way around). Simplifying the plot lines to heatmap(List_f) also does this.Marcelina
This looks to be a bug with Plots' wrapping of PlotlyJS. The IDEs are requesting a different format of the plot, which renders it correctly. Please report it on Plots' issue tracker.Siderolite
Ok, I've just reported it, so the discussion will continue there: github.com/JuliaPlots/Plots.jl/issues/3940Versus
F
0

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

Feeler answered 27/5, 2022 at 20:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.