About 59,400 results
Open links in new tab
  1. how to label x-axis using python matplotlib - Stack Overflow

    Nov 23, 2017 · 9 You need to use plt.xticks() as shown here. It controls what ticks and labels to use for your x-axis. In your example, you will have to add another line as shown below:

  2. python - How to set X and Y axis Title - Stack Overflow

    plt.xlabel('X axis title') will set the x label. So if that isn't working for you please provide a minimal reproducible example and update the question with the ...

  3. How do I set the figure title and axes labels font size?

    from matplotlib import pyplot as plt fig = plt.figure() plt.plot(data) fig.suptitle('test title') plt.xlabel('xlabel') plt.ylabel('ylabel') fig.savefig('test.jpg') I want to specify font sizes for the …

  4. matplotlib strings as labels on x axis - Stack Overflow

    53 For the object oriented API of matplotlib one can plot custom text on the x-ticks of an axis with following code:

  5. python - Rotate tick labels in subplot - Stack Overflow

    25 Just wanted to add another solution that I found on the matplotlib git discussion page: ax[your_axis].tick_params(axis='x', rotation=90) You can specify the axis you want by passing …

  6. `sharex` axis but don't show x-axis tick labels for both, just one

    May 20, 2024 · This is a common gotcha when using shared axes. Fortunately, there's a simple fix: use plt.setp(ax.get_xticklabels(), visible=False) to make the labels invisible on just one …

  7. How to set common axes labels for subplots - Stack Overflow

    I want to create axes labels and titles that span on both subplots. For example, since both plots have identical axes, I only need one set of xlabel and ylabel.

  8. Aligning rotated xticklabels with their respective xticks

    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.

  9. python - Hiding axis text in matplotlib plots - Stack Overflow

    Nov 29, 2016 · I'm trying to plot a figure without tickmarks or numbers on either of the axes (I use axes in the traditional sense, not the matplotlib nomenclature!). An issue I have come across is …

  10. python - Rotate axis tick labels - Stack Overflow

    ax.tick_params(axis='x', labelrotation=90) Matplotlib documentation reference here. This is useful when you have an array of axes as returned by plt.subplots, and it is more convenient than …