Use the legend method of your axes object: http://matplotlib.sourceforge.net/examples/api/legend_demo.html?highlight=codex%20legend
On Tue, Oct 19, 2010 at 11:15 AM, Waléria Antunes David <waleriantu...@gmail.com> wrote: > Hi, > > This example helped me. I have another question. How do I insert the label > as in the example image?: Data from Riess et al (2004) > > Thanks, > Waleria. > > On Tue, Oct 19, 2010 at 3:50 PM, Paul Hobson <pmhob...@gmail.com> wrote: >> >> Waléria, >> >> Hopefully this example helps: >> >> # code... >> import matplotlib.pyplot as plt >> fig = plt.figure() >> ax = fig.add_subplot(111) >> ax.plot([0,1,2], [0,1,3], 'ko') >> >> # set the xticks manually >> ax.set_xticks([0,0.5,1.0,1.5,2]) >> >> # set the yticks using "range" >> ytix = range(6) >> ax.set_yticks(ytix) >> plt.show() >> #...done >> >> --paul >> >> >> >> >> >> On Tue, Oct 19, 2010 at 10:15 AM, Waléria Antunes David >> <waleriantu...@gmail.com> wrote: >> > Hi all, >> > >> > I have a graph. I plotted using python, matplotlib. And i have an >> > example. >> > >> > I need to let the x-axis of my graph, and how do I change plt.ylabel >> > ('Y', >> > size = 10) as the example. >> > >> > Example: In my graph, the x-axis this way: 0.0 ----- 0.2 ------ 0.4 >> > ----- >> > 0.6 ------- 0.8 ------- 1.0 ------- 1.2 -------- 1.4 >> > I need this way: 0 ----- 0.5 ------ 1.0 ----- 1.5 -------- 2 >> > >> > My code: http://pastebin.com/GZqWKwZf >> > >> > Can you help me? >> > >> > Thanks >> > Waleria >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > Download new Adobe(R) Flash(R) Builder(TM) 4 >> > The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly >> > Flex(R) Builder(TM)) enable the development of rich applications that >> > run >> > across multiple browsers and platforms. Download your free trials today! >> > http://p.sf.net/sfu/adobe-dev2dev >> > _______________________________________________ >> > Matplotlib-users mailing list >> > Matplotlib-users@lists.sourceforge.net >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > >> > > > ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users