|
From: JonBL <jc....@bi...> - 2012-07-28 03:51:42
|
I'm unsure about the role of numpy method arange in Matplotlib plots. All Matplotlib examples I have seen call numpy's method arange, and pass the result as the first arg to Matplotlib's plot method. But the following works as expected: --- quote --- import matplotlib.pyplot as plt import numpy as np dom = [1, 3, 4, 5, 7] # Plot domain on x-axis in ascending order of values ran = [7, -2, 11, 5.8, 0] # Plot range on y-axis in 1-to-1 correspondence with domain items fig = plt.figure() ax = plt.subplot(111) ax.plot(dom, ran) plt.grid() plt.show() --- end quote --- I'm not calling numpy.arange(arg) here, but I see the expected plot of 5 co-ordinate points. When should I use numpy.arange(arg) instead of what I have done above? Something to do with the domain that I want to include in the plot? TIA, Jon -- View this message in context: http://old.nabble.com/Role-of-numpy-Method-arange-in-Matplotlib-tp34223354p34223354.html Sent from the matplotlib - users mailing list archive at Nabble.com. |