<div dir="ltr"><div><div><div><div>The "fig.text()" call returns a Text artist. You can remove it later if you like by calling its "remove()" method. If your concern is mostly that the subsequent plots are appearing on top of it, and you would like the text to always be on top, you can set its "zorder" value to be something large, like 10:<br></div><br>text = fig.text(0.13, 0.85, "Now is the time", fontsize=10, zorder=10)<br><br></div>As for grids, you can turn that on with "ax.grid(True)".<br><br></div>Cheers!<br></div>Ben Root<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 10, 2015 at 5:59 AM, garyr <span dir="ltr"><<a href="mailto:garyr@fidalgo.net" target="_blank">garyr@fidalgo.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a PyQt4 program that has matplotlib imbedded. I followed the example code<br>
in embedding_in_qt4.py and the plotting works very well but I have a couple of questions.<br>
<br>
I would like to display some text in the plot area. I can do that but the text is overwritten by subsequent plots. Is there a way to clear the text between plots? I would also like to display a grid. Is that possible?<br>
<br>
Below is an outline of my plotting code.<br>
<br>
=========================================<br>
from embedding_in_qt4  import MyMplCanvas<br>
<br>
   self.mplEmbed = MyMplCanvas()<br>
<br>
   def test(self):<br>
       t = arange(0.0, 3.0, 0.01)<br>
       s = sin(2*pi*t)<br>
       ax = self.mplEmbed.axes<br>
       fig = self.mplEmbed.fig<br>
       fig.text(0.13, 0.85, "Now is the time", fontsize=10)<br>
       fig.suptitle("The quick brown fox")<br>
       ax.plot(t, s)<br>
       self.mplEmbed.draw()<br>
<br>
<br>
_______________________________________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org" target="_blank">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/matplotlib-users</a><br>
</blockquote></div><br></div>