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.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to