
Changing the tick frequency on the x or y axis - Stack Overflow
The plt.plot (or ax.plot) function will automatically set default x and y limits. If you wish to keep those limits, and just change the stepsize of the tick marks, then you could use ax.get_xlim() to …
matplotlib - set ticks with logarithmic scale - Stack Overflow
Mar 20, 2017 · Matplotlib bad ticks/labels for loglog (twin axis) 0. Add custom logarithmic tick location to matplotlib. 1.
python - add custom tick with matplotlib - Stack Overflow
Mar 25, 2018 · In this case however it seems your requirement is different. While the linked question asks for leaving the ticks unchanged, here you want to set the ticks manually …
python - reducing number of plot ticks - Stack Overflow
Note that you can get uneven ticks if you wish, e.g. myticks = [1, 3, 8]. Then you can use. plt.gca().set_xticks(myticks) # set new X axis ticks or if you want to replace labels as well. …
Specify format of floats for tick labels - Stack Overflow
class matplotlib.ticker.StrMethodFormatter(fmt) Use a new-style format string (as used by str.format()) to format the tick. The field used for the value must be labeled x and the field used …
python - How to change tick label font size - Stack Overflow
Jun 17, 2011 · In a matplotlib figure, how can I make the font size for the tick labels using ax1.set_xticklabels() smaller? Further, how can one rotate it from horizontal to vertical?
python - How to get ticks every hour - Stack Overflow
Jan 1, 2017 · Consider this simple example import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter import matplotlib.dates as …
python - Show tick labels when sharing an axis - Stack Overflow
The ticks that are missing have had their visible property set to False. This is pointed out in the documentation for plt.subplot. The simplest way to fix this is probably to do: for ax in …
how to turn on minor ticks only on y axis - Stack Overflow
Oct 3, 2012 · Alternatively, we can get minor ticks at default locations using AutoMinorLocator: import matplotlib.pyplot as plt import matplotlib.ticker as tck fig, ax = plt.subplots() plt.plot([1,2]) …
python - How to force integer tick labels - Stack Overflow
The following solution by simply casting the index i to string worked for me:. import matplotlib.pyplot as plt import time datay = [1,6,8,4] # Just an example datax = [] # In the …