New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Colorbar Is Missing When Plotting Geometries #3368
Comments
I would use using DataFrames
using Plots
using Shapefile
states = Shapefile.Table("cb_2018_us_state_5m.shp") |> DataFrame
skip = ["02", "15", "60", "66", "69", "72", "78"]
filter!(row -> !(row[:STATEFP] in skip), states)
sort!(states, [:GEOID])
n = size(states, 1)
plot(states.geometry, fill_z=rand(1, n), title="My title", cbar=true, color=:seismic) |
ahh, I didn't realize the code said |
Perfect @mkborregaard and @daschw ! Since I hadn't really seen this documented anywhere in the ecosystem, could I add a docs PR somewhere with this as an example? |
Sure, that would be great. I'd say either somewhere at http://docs.juliaplots.org/latest/colors/ or at http://docs.juliaplots.org/latest/attributes/ would be the right place. |
Hey @daschw - before I create this PR, what is fill_z exactly doing? I was a bit confused about |
automatically reinterprets a vector of numbers on a color scale and adds a colorbar for the mapping |
|
Details
When plotting geometries, the colorbar does not show up even with
colorbar=true
explicitly.I was chatting with @mkborregaard today about what I thought was just a gripe (:grapes:) about this being an implementation quirk. Instead, it was actually a bug I discovered and he wanted me to open the issue!Here is the code to reproduce the error
The associated shapefile is located in this zip here: https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_state_5m.zip
Please let me know if you want me to test anything here - thanks for the great package and great work so far! 😄
Backends
This bug occurs on ( insert
x
below )Versions
Plots.jl version: v1.11.0
Backend version (
]st -m
): [d2c73de3] GR_jll v0.53.0+0Output of
versioninfo()
:The text was updated successfully, but these errors were encountered: