How do I get control over the axis settings of a pyplot plot. I have simply done
pylab.plot(*self.plot_generator(low, high))
pylab.show()
and I get this which is what I want
but I want the x axis to be at 0 instead of at the bottom. How would I do that?
To specify the value of axes, create a list of characters. Use xticks and yticks method to specify the ticks on the axes with x and y ticks data points respectively. Plot the line using x and y, color=red, using plot() method. Make x and y margin 0.
To set start of x-axis to 0:
pylab.xlim(xmin=0)
To set start of y-axis to 0:
pylab.ylim(ymin=0)
Put one of these lines (or both if you'd like) after the pylab.plot
call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With