2020-04-01 23:52:09 +0100 | received badge | ● Student (source) |

2020-03-31 15:19:34 +0100 | asked a question | range() function in list_plot not working? I'm trying to generate a list plot of points that satisfy the relation { (x,2x) | x = 0,+-1, +-2 }. That is, 5 discrete integer values of x ranging from -2 to +2 that satisfy the equation y = 2x. I figured my solution...show(list_plot([x*2 for x in range(-2,3)]), figsize=3) should have worked; however, the resulting plot ends up shifted to the incorrect domain. I can't upload the image because my karma is too low, but the resulting plot fits the function y = 2(x - 2). It gives the correct range of y values, from -4 to 4, but the domain is from 0 to 4. Anybody know what I'm missing? Thanks! |

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.