File tree 1 file changed +3
-7
lines changed
examples/text_labels_and_annotations 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 9
9
described at http://matplotlib.org/users/usetex.html
10
10
properly installed on your system. The first time you run a script
11
11
you will see a lot of output from tex and associated tools. The next
12
- time, the run may be silent, as a lot of the information is cached in
13
- ~/.tex.cache
12
+ time, the run may be silent, as a lot of the information is cached.
14
13
15
14
Notice how the the label for the y axis is provided using unicode!
16
15
26
25
t = np .linspace (0.0 , 1.0 , 100 )
27
26
s = np .cos (4 * np .pi * t ) + 2
28
27
29
- t = np .arange (0.0 , 1.0 + 0.01 , 0.01 )
30
- s = np .cos (2 * 2 * np .pi * t ) + 2
31
-
32
28
fig , ax = plt .subplots (figsize = (6 , 4 ), tight_layout = True )
33
29
ax .plot (t , s )
34
30
35
31
ax .set_xlabel (r'\textbf{time (s)}' )
36
- ax .set_ylabel ('\\ textit{Velocity (\u00B0 /sec)}' )
32
+ ax .set_ylabel ('\\ textit{Velocity (\N{DEGREE SIGN} /sec)}' , fontsize = 16 )
37
33
ax .set_title (r'\TeX\ is Number $\displaystyle\sum_{n=1}^\infty'
38
- r'\frac{-e^{i\pi}}{2^n}$!' )
34
+ r'\frac{-e^{i\pi}}{2^n}$!' , fontsize = 16 , color = 'r' )
39
35
plt .show ()
You can’t perform that action at this time.
0 commit comments