2

In this question, generation of an arrow within xlabel/ylabel was explained. The explanation provides an example:

import matplotlib.pyplot as plt 
fig, ax = plt.subplots(1, 1)
# plot your data here ...

ax.set_xlabel(r'$\rho/\rho_{ref}\;\rightarrow$', color='red')
ax.set_ylabel(r'$\Delta \Theta / \omega \longrightarrow$')

plt.show()

Resulting below:

.

How could one scale only arrow without scaling the text therein?

Herpes Free Engineer
  • 2,425
  • 2
  • 27
  • 34
  • 1
    I will take this opportunity to advertise [this set of functions I wrote](https://github.com/saintsfan342000/MPL-a-al-SKK) to format matplotlib figures in a way that suit my advisor's tastes. He also likes putting arrows on the axis labels. I implemented them using the FancyArrow. Have a look at the Tutorial. – saintsfan342000 Aug 03 '17 at 19:36

1 Answers1

1

If you use LaTeX to render the text (using rcParams), then you can use LaTeX size commands to change parts of the text. E.g.:

import matplotlib.pyplot as plt 
plt.rcParams['text.usetex'] = True

fig, ax = plt.subplots(1, 1)

ax.set_xlabel(r'$\rho/\rho_{ref} \;$ \Huge{$ \rightarrow $}', color='red')
ax.set_ylabel(r'$\Delta \Theta / \omega $ \Huge{$\longrightarrow$}')

plt.show()

enter image description here

tmdavison
  • 64,360
  • 12
  • 187
  • 165