holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.14k stars 109 forks source link

Inconsitencies with `hvplot.extension(compatibility)` #1381

Open LecrisUT opened 3 months ago

LecrisUT commented 3 months ago

Extracting the comments from: https://github.com/holoviz/hvplot/pull/1380#issue-2430199101 (relates to MATPLOTLIB_TRANSFORMS and hvplot.extension(compatibility))

I have encountered a few other issues that could be addressed here:

  • Missing markers compatibility. Reference 1
  • (marker) size is inconsistent, I am multiplying by 20 and seems alright?
  • Edges are not color linked by default. Don't know how to address this
maximlt commented 3 months ago

Missing markers compatibility. Reference 1 2

In fact you need to reference HoloViews docs/code, it provides the interface between hvPlot and the plotting backends (Bokeh, Matplotlib, Plotly). In other words, neither hvPlot nor HoloViews transparently passes plotting options to the backends, the supported ones are defined in HoloViews.

(marker) size is inconsistent, I am multiplying by 20 and seems alright? Edges are not color linked by default. Don't know how to address this

More precision and examples would be welcome.

LecrisUT commented 3 months ago

Missing markers compatibility. Reference 1 2

In fact you need to reference HoloViews docs/code, it provides the interface between hvPlot and the plotting backends (Bokeh, Matplotlib, Plotly). In other words, neither hvPlot nor HoloViews transparently passes plotting options to the backends, the supported ones are defined in HoloViews.

Unfortunately there is no one good reference page to navigate and find what the available options are. In some places it even mentions using <Tab> autocomplete, but that obviously does not work with things like xarray.DataArray.hvplot(), it doesn't work with static autocomplete, etc.

  • (marker) size is inconsistent, I am multiplying by 20 and seems alright?
  • Edges are not color linked by default. Don't know how to address this

More precision and examples would be welcome.

I am doing something like


    overlay = param.rx(holoviews.Overlay())
    overlay *= plotter.plot(data, x="coord.",
                            indexers={None: rx_bands[:rx_occupied]},
                            plot_opts={"line_dash": "solid"})
    overlay *= plotter.plot(data, kind="scatter", x="coord.",
                            indexers={None: rx_bands[:rx_occupied], "coord.": k_coord[::rx_scatter_skip]},
                            plot_opts={"marker": "circle", "size": rx_scatter_size})
    overlay *= plotter.plot(data, x="coord.",
                            indexers={None: rx_bands[rx_occupied:]},
                            plot_opts={"line_dash": "solid", "color": "black"})
    overlay *= plotter.plot(data, kind="scatter", x="coord.",
                            indexers={None: rx_bands[rx_occupied:], "coord.": k_coord[::rx_scatter_skip]},
                            plot_opts={"marker": "circle", "fill_color": "none", "line_color": "black", "size": rx_scatter_size})

Here are examples when I do multiply the marke size by 20

![Screenshot_20240726_124320](https://github.com/user-attachments/assets/283895ed-6737-42db-8f5c-133618b892af) ![Screenshot_20240726_124343](https://github.com/user-attachments/assets/921a9218-c224-419a-91ba-14ca606c4a2a)

And if I disable my setup, and do things more vanilla and disabling the hard-coded black color:

![Screenshot_20240726_124845](https://github.com/user-attachments/assets/3bf765f7-3423-4047-b5c4-acf7e386b7a5) ![Screenshot_20240726_124903](https://github.com/user-attachments/assets/e0193bd7-d738-4baf-ac94-fbd889d64a2a)