So I have a graph that runs on an order of magnitude 10000 time steps, and thus I have a lot of data points and the xticks are spaced pretty far apart, which is cool, but I would like to to show on the xaxis the point at which the data is being plotted. In this case the xtick I want to show is 271. So is there a way to just "insert" 271 tick onto the x axis given that I already know what tick I want to display?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
If it's not important that the ticks update when panning/zomming (i.e. if the plot is not meant for interactive use), then you can manually set the tick locations with the
axes.set_xticks()
method. In order to append one location (e.g.271
), you can first get the current tick locations withaxes.get_xticks()
, and then append271
to this array.A short example:
This produces
As you can see from the image, a tick has been added for
x=271
.