Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Taking into account Emmanuel Charpentier’s comment, I propose the following solution, which consists of specifying the data on the axes manually:

plot(x,2,10^6,ticks=[[2,10^6/2,10^6],[2,10^6/2,10^6]], tick_formatter=[[2,10^6/2,10^6],[2,10^6/2,10^6]])
click to hide/show revision 2
No.2 Revision

Taking into account Emmanuel Charpentier’s comment, I propose the following solution, which consists of specifying the data on the axes manually:

plot(x,2,10^6,ticks=[[2,10^6/2,10^6],[2,10^6/2,10^6]], tick_formatter=[[2,10^6/2,10^6],[2,10^6/2,10^6]])

or

def Plot(f,min,max,n): labX = [ min + k(max-min)/n for k in range(n+1)] labY = [ f(min + k(max-min)/n) for k in range(n+1)] P=plot(f,min,max,ticks=[labX,labY], tick_formatter=[labX,labY]) P.show() Plot(lambda x : x,0,10^6,5)

click to hide/show revision 3
No.3 Revision

Taking into account Emmanuel Charpentier’s comment, I propose the following solution, which consists of specifying the data on the axes manually:

plot(x,2,10^6,ticks=[[2,10^6/2,10^6],[2,10^6/2,10^6]], tick_formatter=[[2,10^6/2,10^6],[2,10^6/2,10^6]])

or

def Plot(f,min,max,n):
    labX = [ min + k(max-min)/n k*(max-min)/n for k in range(n+1)]
    labY = [ f(min + k(max-min)/n) k*(max-min)/n) for k in range(n+1)]
    P=plot(f,min,max,ticks=[labX,labY], tick_formatter=[labX,labY])
    P.show()
Plot(lambda x : x,0,10^6,5)

x,0,10^6,5)