If desired, the default CDAT logo, located at the bottom right of a plot, can be turned off.
An additional logo can also be displayed.
To download this Jupyter Notebook, right click on the link and choose "Download Linked File As..." or "Save Link as...". Remember where you saved the downloaded file, which should have an .ipynb extension. (You'll need to launch the Jupyter notebook or JupyterLab instance from the location where you store the notebook file.)
# Sample data import requests r = requests.get("https://cdat.llnl.gov/cdat/sample_data/clt.nc",stream=True) with open("clt.nc","wb") as f: for chunk in r.iter_content(chunk_size=1024): if chunk: # filter local_filename keep-alive new chunks f.write(chunk)
import cdms2, vcs f = cdms2.open('clt.nc') d = f('clt') x = vcs.init() x.plot(d)
x.drawlogooff() x.clear() x.plot(d)
x.drawlogoon() x.clear() x.plot(d)
Place the image file for the logo you want to add to the plot in the same directory as this notebook. In this example, we use an LLNL logo file called "logo.png" which can be downloaded from this notebook's GitHub repository: https://github.com/CDAT/Jupyter-notebooks/tree/master/vcs/Logo_Control.
vcs.utils.Logo() method allows you to plot the additional logo.
The default location of the new logo is at the top right.
x.clear() logo2 = vcs.utils.Logo('./logo.png') logo2.plot(x) x.plot(d)
You can adjust the position of the logo by using the
The value of
.y should be between 0 and 1 since they represent a ratio of the relative position on the canvas. (
logo2.x = 0.5 would be 50% of the way across the canvas in the x direction.)
x.clear() logo2 = vcs.utils.Logo('./logo.png') logo2.x = .05 logo2.y = .05 logo2.plot(x) x.plot(d)