Part 2 – Graphs
In Part 9 what is numpy.linspace() doing? It seems redundant to me?
I mean I think the deal here is that you have linspace in the code but you’re graphing this using the default plot type which is a line, so it makes no difference. If you change the code to plt.plot(x, -x+3, ‘r^’) - that is top use red triangles - then the linspace has an effect: you can change the number of triangles used to mark out the line.
The inclusion of linspace seems needlessly confusing.
Note this is the same for most of the following examples.
The use of linspace is the standard way to create a bunch of x values that you want to use to plot a function.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.