axis-labels

matplotlib: Aligning y-axis labels in stacked scatter plots

matplotlib: Aligning y-axis labels in stacked scatter plots Question: In the plot bellow i have two scatter plots which have different number scale, so their Y-axis labels are not aligned. Is there any way I can force the horizontal alignment in the y-axis labels? import matplotlib.pylab as plt import random import matplotlib.gridspec as gridspec random.seed(20) …

Total answers: 5

Aligning rotated xticklabels with their respective xticks

Aligning rotated xticklabels with their respective xticks Question: Check the x axis of the figure below. How can I move the labels a bit to the left so that they align with their respective ticks? I’m rotating the labels using: ax.set_xticks(xlabels_positions) ax.set_xticklabels(xlabels, rotation=45) But, as you can see, the rotation is centered on the middle …

Total answers: 6

How to force the Y axis to only use integers in Matplotlib

How to force the Y axis to only use integers Question: I’m plotting a histogram using the matplotlib.pyplot module and I am wondering how I can force the y-axis labels to only show integers (e.g. 0, 1, 2, 3 etc.) and not decimals (e.g. 0., 0.5, 1., 1.5, 2. etc.). I’m looking at the guidance …

Total answers: 4