7

I have created a heatmap plot using in Julia by using the Plotly with the Plots package. I generate the heatmap with the following command heatmap(10^9 .* (height + deformation)). Then, I get a plot that looks like this heatmap

The length of the x-axis and y-axis both range from 0 to 256, but nonetheless they do not have the same scale as seen from the rectangular shape of the heatmap. How can I make the scale of the x-axis and y-axis equal?

1 Answer 1

9

You can use aspect_ratio attribute with :equal option.

heatmap(10^9 .* (height + deformation), aspect_ratio=:equal)

should give you equally scaled x and y axes. If you give a number instead of :equal, plot area is resized so that 1 y-unit is the same size as aspect_ratio x-units.

You can see other attributes to use with Plots.jl in the relevant section of Plots.jl documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.