Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Restricting the y range using ymin or ymax does the trick while using text in 2d plots. Here's the code,

p1 = plot(fresnel_sin(t), (t, -pi, pi), ticks=[pi/4,0.1], tick_formatter=[pi,None], legend_label=r'$f(x) = \int_0^x \sin(\frac{\pi t^2}{2})dt$', axes_labels=[r'$x$', r'$f(x)$'], axes_labels_size=1.5, ymin=-0.7, ymax=0.8, fontsize=12)
p1.set_legend_options(back_color=(0.9,0.9,0.9), shadow=False, font_size=14, loc=(0,0.7))
p2 = text('Fresnel\'s sin ', (0, 1.1), fontsize=14, color='black')
p1 + p2

But there should be a more direct way of doing it like in matplotlib. One has the title attribute for the object p1, where one can configure the title by providing a fontdict.