Use `color` instead of `by` when possible

Using color is faster (likely vectorized, done in 4s)

import pandas as pd

NETWORKS_URL = "https://mesonet.agron.iastate.edu/sites/networks.php?network=_ALL_&format=csv&nohtml=on"

networks_df = pd.read_csv(NETWORKS_URL)
networks_df.hvplot.scatter("lon", "lat", hover_cols=["stid", "station_name"], color="iem_network", legend=False)

vs using by which is looping through overlays (I think, done in 17.5 s)

import pandas as pd

NETWORKS_URL = "https://mesonet.agron.iastate.edu/sites/networks.php?network=_ALL_&format=csv&nohtml=on"

networks_df = pd.read_csv(NETWORKS_URL)
networks_df.hvplot.scatter("lon", "lat", hover_cols=["stid", "station_name"], by="iem_network", legend=False)

1 Like

That makes sense however I am not sure why the two codes give slightly different colors

I think color is controlled by cmap while by just cycles through the default overlay colors.