1) Select the XYZ and the part of the World you want
2) Right click on the layer --> Export --> Save As (it will open window)
3) Select:
Check: 'Rendered Image'
Uncheck: 'Create VRT'
Choose directory and name (with .tif)
Select the CRS 'Project CRS: EPSG:4326 - WGS 84 (you must have done for set the project to show the longitude/latitude in the project settings)
Click 'Map Canvas Extend' (easier, or select the appropriate coordinates...)
Choose the resolution, in this case, 'degrees'
Than... OK! A new layer will appear in the project and the file will be save on the destination!
import rasterio
from rasterio.plot import show
basemap = rasterio.open(r'd:\GUTO\1_Trabs\2_Plataforma\PlaRS\BaseGeografica\recorte_plataforma_rs2.tif')
show(basemap)
<AxesSubplot:>
import matplotlib.pyplot as plt
# Albardão lighthouse coordinates... (from Google Earth)
longitude = -52.706006
latitude = -33.202726
fig, ax = plt.subplots()
plt.plot(longitude, latitude, 'ro')
show(basemap, ax=ax)
<AxesSubplot:>