[Matplotlib-users] automatic list of r'$2$'...

Vincent Douce Mathoscope mathoscope at netcourrier.com
Wed Dec 13 13:52:08 EST 2017


hi
i try this :
'''
Lx,x,Ly,y=[],xmin,[],ymin
Lrx,Lry=[],[]
while (x<=xmax):
    Lx.append(x)
    Lrx.append("$".join(["r'",str(x),"'"]))
    x+=1
while (y<=ymax):
    Ly.append(y)
    y+=1
'''
but it creates a Lrx list like this :
["r'$-2.5$'", "r'$-1.5$'", "r'$-0.5$'", "r'$0.5$'", "r'$1.5$'", "r'$2.5$'"]
and i want to obtain
[r'$-2.5$', r'$-1.5$', r'$-0.5$', r'$0.5$', r'$1.5$', r'$2.5$']

i guess that r is an operator to deal with the $..$ expressions but not understand how to fix my definition

thanks for your help

Vincent

        ––––––––––––––––––––––––––
                  Vincent Douce
               :=: Mathoscope :=:
             http://mathoscope.xyz <http://mathoscope.xyz/>
                 06°13°11°07°26
          Bagnères de Bigorre 65200




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20171213/323e6812/attachment-0001.html>


More information about the Matplotlib-users mailing list