-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
densitymapbox doesn't generate a valid visualization #484
Comments
You did not give any values to be mapped to a colorscale in order to get a density.
LE: To display on hover all information contained in the dataframe, you should include
|
The line that fixes the issue is the |
Your MWE contained just |
But without z the generated plot has NO meaning.
What does it represent? Compare with the first densitymapbox.! Heatmaps, contour plots and here densitymapbox need z-values to be mapped to a colorscheme. |
A density map doesn't require z values. The density is computed based on the proximity of points in the map. The z values are just an option to adjust the heights of the density. The issue I am reporting above has no relation with the specification of the z attribute. It is about the layout that is not set correctly by default. To fix the issue one has to manually call plot(densitymapbox(...), Layout(....)) |
I'm sure you know what is a density. It's not the density of geographic locations, but the density of values associated to them. The mapbox layout cannot be set directly, by default, because each user wants to display a particular region of the globe, and so with different mapbox centers. |
So you mean that the current behavior is acceptable? I believe that this is very bogus without the actual density being displayed by default. The density of geographic locations is a particular case of density estimation with constant z value. We have tons of similar interpolation methods in our GeoStats.jl stack, and know in depth all the details that go into density estimation. I feel that the PlotlyJS.jl behavior is buggy, and that beginners will struggle producing the simplest maps when nothing is shown by default. If the trace is called |
@empet , What do you think the role of the According to the link you gave: The parameter It says the parameter is basically a weight of the corresponding point. It might be an issue of |
Yes you may use it without z-values, but with NO MEANING. Look here at a geographical region
|
Any density estimation procedure depends on a bandwidth or radius of a
moving window. If you set the radius = 1 you'll see more detail. If you set
radius = 10 the points collapse into one as they are within the same window.
The z value only controls the height of the peaks.
Em sáb., 9 de mar. de 2024 06:55, Math, Python & Julia <
***@***.***> escreveu:
… Yes you may use it without z-values, but with NO MEANING. Look here at a
geographical region
within Pacific Ocean (no island around), with lon, lat, at a distance of
two units, and
and two locations at a smaller distance around Paris. We get the same
density.
How do you interpret this similarity between the two densities?
fig1 = Plot(densitymapbox(lat=[-1, 1], lon=[177, 179]))
relayout!(fig1, mapbox_style="open-street-map", mapbox_center_lon=160, mapbox_center_lat=0,
width=600, height=350)
ocean.png (view on web)
<https://github.com/JuliaPlots/PlotlyJS.jl/assets/3627253/61a5e78b-dbcf-490d-b2c4-e9f75d58b597>
fig2 = Plot(densitymapbox(lat=[48.25, 49], lon=[2, 2.5]))
relayout!(fig2, mapbox_style="open-street-map", mapbox_center_lon=2.25, mapbox_center_lat=48.5,
width=600, height=350)
Paris.png (view on web)
<https://github.com/JuliaPlots/PlotlyJS.jl/assets/3627253/4c344542-c393-4ead-840d-097e4c5a014e>
—
Reply to this email directly, view it on GitHub
<#484 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZQW3N3WIUR3NTVLFX6YPDYXLL7TAVCNFSM6AAAAABEM3TVCSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBWHAYTCNZUGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@empet , I have little knowledge about the geographical things. Yet I think the point of the issue is why the Then the question is whether it is specific to @juliohm , You may try the same in Python. |
Python version works in this case (of densitymapbox) like PlotlyJS.
don't display anything, because |
I will close the issue given that the bug is in the underlying Javascript library. It feels very unpolished, the typical Javascript experience. |
Describe the bug
The
densitymapbox
trace doesn't generate a valid visualization.Version info
PlotlyJS v0.18.13
MWE
The text was updated successfully, but these errors were encountered: