<jupyter_start><jupyter_text>Exercise 1: Plotting In this exercise we will try making some of our own visualizations using hvplot. Loading the data We will be building a new visualization based on the same data we have cleaned and filtered in the rest of the tutorial. First we load the earthquakes `DataFrame` and filter to those with `>=7` magnitude:<jupyter_code>import pandas as pd 
import xarray as xr

import hvplot.pandas # noqa: adds hvplot method to pandas objects
import hvplot.xarray # noqa: adds hvplot method to xarray objects

df = pd.read_parquet('../../data/earthquakes-projected.parq')
df.time = df.time.astype('datetime64[ns]')
df = df.set_index(df.time)
most_severe = df[df.mag >= 7]<jupyter_output><empty_output><jupyter_text>And next we load the population density raster data:<jupyter_code>ds = xr.open_dataarray('../../data/raster/gpw_v4_population_density_rev11_2010_2pt5_min.nc')
cleaned_ds = ds.where(ds.values != ds.nodatavals).sel(band=1)
cleaned_ds.name = 'population'<jupyter_output><empty_output><jupyter_text>Visualizing the raster dataStart by using `hvplot.image` to visualize the whole of the population density data using the Datashader support in hvPlot. Grab a handle on this `Image` HoloViews object called `pop_density` and customize it in the `.hvplot.image` call, enabling a logarithmic color scale and a blue colormap (specifically the `'Blues'` colormap). At the end of the cell, display this object.HintDon't forget to include `rasterize=True` in the `hvplot.image` call.  You can also use `logz=True`, `clim=(1, np.nan)` and `cmap='Blues'`.<jupyter_code>pop_density = ... # Use hvplot here to visualize the data in cleaned_ds
pop_density  # Display it<jupyter_output><empty_output><jupyter_text>Solution```pythonpop_density = cleaned_ds.hvplot.image(rasterize=True, logz=True, clim=(1, np.nan), cmap='Blues') pop_density```  Visualizing the earthquake positionsNow visualize the tabular data in `most_severe` by building a `hv.Points` object with `.hvplot`. This will be very similar to the approach shown in the tutorial but this time we want all the earthquakes to be marked with red crosses of size 100. As above, get a handle on the resulting object and display it where the handle is now called `quake_points`._Hint: To figure out which arguments you need to pass, try `help(most_severe.hvplot.points)`, then if you can find the right option for marking the points but don't know what value to pass, try passing an invalid value to see from the error message what the valid options are._HintDon't forget to map the longitude and latitude dimensions to `x` and `y` in the call to `hvplot.points`.<jupyter_code>quake_points = ... # Use hvplot here to visualize the data in most_severe 
quake_points<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08462369463449766, 'fraction_numerical': 0.007202016564638099, 'mean_word_length': 5.505854800936768, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '375092', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 885, 'n_tokens_neox': 833, 'n_words': 337, 'path': 'examples/tutorial/exercises/Plotting.ipynb', 'repo_name': 'ablythed/holoviz', 'size': '2777'}