Open In App

Matplotlib.axis.Tick.get_url() in Python

Last Updated : 01 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. It is an amazing visualization library in Python for 2D plots of arrays and is used for working with the broader SciPy stack.

matplotlib.axis.Tick.get_url() Function

The Tick.get_url() function in axis module of matplotlib library is used to get the url.

Syntax: Tick.get_url(self)

Parameters: This method does not accepts any parameter. 

Return value: This method return the url.

Below examples illustrate the matplotlib.axis.Tick.get_url() function in matplotlib.axis: 

Example 1: 

Python3




# Implementation of matplotlib function
from matplotlib.axis import Tick
import numpy as np  
import matplotlib.pyplot as plt  
   
X = np.arange(-10, 10, 0.5)  
Y = np.arange(-10, 10, 0.5)  
U, V = np.meshgrid(X, Y)  
   
fig, ax = plt.subplots()  
ax.scatter(U, V)  
ax.set_url('http://www.google.com')  
fig.canvas.print_figure('Geeks.svg')  
       
ax.text(-5, 10.5, "URL : "
        + str( Tick.get_url(ax)),   
        fontweight ="bold")
   
fig.suptitle('matplotlib.axis.Tick.get_url() \
function Example\n', fontweight ="bold")  
     
plt.show() 


Output:

 

Example 2: 

Python3




# Implementation of matplotlib function
from matplotlib.axis import Tick
import matplotlib.pyplot as plt
import numpy as np
  
fig, ax = plt.subplots()
delta = 0.025
  
x = y = np.arange(-3.0, 3.0, delta)
X, Y = np.meshgrid(x, y)
  
Z1 = np.exp(-X**2 - Y**2)
Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2)
Z = (Z1 - Z2) * 2
  
ax.imshow(Z, interpolation='bilinear',
          cmap="inferno",
          origin='lower',
          extent=[-3, 3, -3, 3])
  
ax.set_title("URL : "+str(Tick.get_url(ax)),
             fontweight="bold")
  
fig.suptitle('matplotlib.axis.Tick.get_url() \
function Example\n', fontweight="bold")
  
plt.show()


Output:

 



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads