user3320864
user3320864

Reputation: 31

scale-range and scale-font for heatmaps and histograms using Julia Plots.jl

I'm creating heatmaps and histograms using Plots.jl. E.g.,

heatmap(labels_x, labels_y, my_data_matrix)

2 questions:

  1. How does one change the font for the tick labels on the color scale?

  2. How does one change the range of the values in the color scale? (I know they automatically span the full range of values, but sometimes you want something different because, for example you want two heatmaps/histograms to have identical scales so they can be easily compared.)

One can, for example, change the font of the tick labels on the axes with

plot!(xtickfont=font(36, "Courier"))

but I would like to change the font of the ticks on the scale. (ztickfont does not work.)

The attributes are listed here: https://juliaplots.github.io/attributes/ I didn't see anything that appears to be what I want, but please point me to the right one if it's there. Thanks.

Upvotes: 3

Views: 1600

Answers (1)

Michael K. Borregaard
Michael K. Borregaard

Reputation: 8044

As @tbreloff noted in his comment, the answer to question #2 is to use the clims keyword. The answer to #1 is, that after https://github.com/JuliaPlots/Plots.jl/pull/1108 the tickfont in the colorbar is the same as the plot's tickfont, in the pyplot backend - we're looking to include this for the other backends as well.

Upvotes: 1

Related Questions