I also tried using makecpt
to create a cpt with more bins. I am only plotting 25 bins because it seems that trying to do more currently terminates the Julia REPL.
using StatsBase
gdp_quantiles=[percentile(gdpneti, 4i) for i in 1:25]
gdp_grd = xyz2grd(gdp_df, region=(-175.5, 175.5, -55.5, 83.5), spacing=(1.0, 1.0), reg=:g)
C=makecpt(cmap=:polar, range=gdp_quantiles, no_bg=true)
coast(water="lightblue", region=(-180, 180, -60, 75), proj=:equidistCylindrical)
grdimage!(gdp_grd, title = "GDP Distribution", nan_alpha=true, colorbar = true, savefig ="hist_gdp.jpg")
The documentation provides the following example:
imshow(makecpt(cmap=(:red,:green,:blue), range=[0,100,300,1000], no_bg=true), horizontal=true)
However, this does not in fact create the kind of cpt I want. The map now only has two colors and looks like this:
I feel like I am fundamentally missing something about how this works.
Also any indication about how to tell the colorbar to plot the colorscale evenly instead of trying to force equidistant values would be super appreciated.