Questions tagged [axis-labels]

The labels on any axis of a plot

The labels on any axis of a plot. For example, the x and y axis labels of a 2D plot.

Use this tag for problems regarding the typography, visibility, layout, and/or placement of the axis labels in your plot.

1631 questions
45
votes
5 answers

Get Rid of Tick Labels for all subplots

Is there a way to get rid of tick labels altogether when creating an array of subplots in Matplotlib? I am currently needing to specify each plot based on the row and column of a larger data set to which the plot corresponds. I've attempted to use…
Palmetto_Girl86
  • 917
  • 2
  • 10
  • 19
43
votes
4 answers

How to display all x labels in R barplot?

This is a basic question but I am unable to find an answer. I am generating about 9 barplots within one panel and each barplot has about 12 bars. I am providing all the 12 labels in my input but R is naming only alternate bars. This is obviously due…
user2760
  • 2,273
  • 7
  • 25
  • 34
43
votes
2 answers

How to make matplotlib show all x coordinates?

For example in the following code: import numpy as np import matplotlib.pyplot as plt N = 10 x = [1,2,3,4,5,6,7,8,9,10] y = np.random.rand(N) plt.scatter(x, y) plt.show() I get the following plot as you can see, in the x axis, only the even…
jsguy
  • 2,069
  • 1
  • 25
  • 36
41
votes
7 answers

d3.js: Align text labels between ticks on the axis

Is there an easy way to align text labels between ticks? Here is my time axis with labels above the ticks: I would like to place these labels like here:
oluckyman
  • 3,566
  • 3
  • 28
  • 35
41
votes
3 answers

How to limit d3.svg.axis to integer labels?

Is there any possibility to limit the number of d3.svg.axis integer labels displayed on the graph? Take for instance this graph. There are only 5 sizes here: [0, 1, 2, 3, 4]. However, the ticks are also displayed for .5, 1.5, 2.5 and 3.5.
Gajus
  • 69,002
  • 70
  • 275
  • 438
40
votes
4 answers

Axis labels on two lines with nested x variables (year below months)

I would like to display months (in abbreviated form) along the horizontal axis, with the corresponding year printed once. I know how to display month-year: The un-needed repetition of the year clutters the labels. Instead I would like something…
PatrickT
  • 10,037
  • 9
  • 76
  • 111
40
votes
7 answers

How to set axis ticks in multiples of pi (Python) (matplotlib)

I'd like to make a plot in Python and have x range display ticks in multiples of pi. Is there a good way to do this, not manually? I'm thinking of using matplotlib, but other options are fine. EDIT 3: EL_DON's solution worked for me like this:…
Zubo
  • 1,543
  • 2
  • 20
  • 26
36
votes
3 answers

Show decimal places and scientific notation on the axis

I am plotting some big numbers with matplotlib in a pyqt program using python 2.7. I have a y-axis that ranges from 1e+18 to 3e+18 (usually). I'd like to see each tick mark show values in scientific notation and with 2 decimal places. For example…
tempneff
  • 365
  • 1
  • 3
  • 4
33
votes
1 answer

Rotating axes label text in 3D

How do I rotate the z-label so the text reads (bottom => top), rather than (top => bottom)? import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.set_zlabel('label…
Hooked
  • 84,485
  • 43
  • 192
  • 261
32
votes
5 answers

matplotlib: Aligning y-axis labels in stacked scatter plots

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…
dimka
  • 4,301
  • 11
  • 31
  • 36
30
votes
2 answers

Suppress ticks in plot in r

I want to remove labels and axis from X axis, however adding new ticks. plot(1:10, ylab = "") at1 <- seq(1, 10, 0.1) axis(side = 1, at = at1, labels = FALSE) I could not get rid of y labels.
SHRram
  • 4,127
  • 7
  • 35
  • 53
27
votes
2 answers

Thousand separator in label of x or y axis

I would like to have pretty labels on the y-axis. For example, I prefer to have 1,000 instead of 1000. How can I perform this in ggplot? Here is a minimum example: x <- data.frame(a=c("a","b","c","d"), b=c(300,1000,2000,4000)) ggplot(x,aes(x=a,…
giordano
  • 2,954
  • 7
  • 35
  • 57
27
votes
2 answers

Matplotlib axis label: \theta does not work \Theta does

I have a weird behaviour in matplotlib. Using the following I get a nice and shiny big theta. As soon as I use \theta instead of \Theta I get heta as an axis label plt.figure(**pd.figpropsHP) line=pd.lineCycler() for i in range(2): for j in…
louis cypher
  • 667
  • 1
  • 6
  • 13
26
votes
2 answers

Format axis tick labels to percentage in plotly

I am creating bar charts in plotly with y-axis representing percentages or shares within 0-1. The y-axis displays as 0.05 instead of 5.0%. Is there a way to display y-axis tick labels as %##? I have tried using tickformat = "%" but that doesn't seem…
Binny
  • 263
  • 1
  • 3
  • 7
26
votes
1 answer

Change the color of the axis labels

Here's the relevant code: ggplot.3plus<-ggplot(summary.3plus, aes(x=sp1, y=fract.mean, fill=ForestAge)) + geom_bar(position=position_dodge())+ coord_cartesian(ylim = c(1, 1.175))+ geom_errorbar(aes(ymin=fract.mean-se, ymax=fract.mean+se), …
Luke
  • 4,769
  • 5
  • 28
  • 36