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.

1330 questions
166
votes
5 answers

Remove plot axis values

I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph. I know that axes = false will get rid of the entire axis, but I would only like to get rid of the numbering.
user130633
  • 2,073
  • 4
  • 17
  • 11
106
votes
8 answers

Rotating x axis labels in R for barplot

I am trying to get the x axis labels to be rotated 45 degrees on a barplot with no luck. This is the code I have below: barplot(((data1[,1] - average)/average) * 100, srt = 45, adj = 1, xpd = TRUE, …
David
  • 2,564
  • 5
  • 23
  • 29
96
votes
3 answers

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

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 notes and…
Jay Gattuso
  • 3,250
  • 8
  • 31
  • 50
95
votes
6 answers

d3 axis labeling

How do I add text labels to axes in d3? For instance, I have a simple line graph with an x and y axis. On my x-axis, I have ticks from 1 to 10. I want the word "days" to appear underneath it so people know the x axis is counting days. Similarly, on…
user1474218
  • 985
  • 1
  • 7
  • 5
63
votes
4 answers

Wrap long axis labels via labeller=label_wrap in ggplot2

I would like to automatically wrap my labels in ggplot2, i.e. insert line breaks of long labels. Here is written how to write a function (1) for it, but sadly I do not know where to put labeller=label_wrap in my code (2). (1) function by…
Til Hund
  • 1,303
  • 4
  • 19
  • 36
45
votes
2 answers

In R base plot, move axis label closer to axis

I have eliminated labels on the y axis because only the relative amount is really important. w <- c(34170,24911,20323,14290,9605,7803,7113,6031,5140,4469) plot(1:length(w), w, type="b", xlab="Number of clusters", ylab="Within-cluster…
C8H10N4O2
  • 15,256
  • 6
  • 74
  • 113
44
votes
1 answer

Superscript and subscript axis labels in ggplot2

I need an axis label in ggplot2 which reads "Assimilation (μmol CO2 m-2 s-1)" with the 2 of CO2 as subscript and the -2 and -1 as superscript. Thanks.
Becky Martin
  • 451
  • 1
  • 4
  • 3
44
votes
2 answers

Matplotlib showing x-tick labels overlapping

Have a look at the graph below: It's a subplot of this larger figure: I see two problems with it. First, the x-axis labels overlap with one another (this is my major issue). Second. the location of the x-axis minor gridlines seems a bit wonky. …
8one6
  • 10,670
  • 11
  • 50
  • 78
44
votes
6 answers

Multirow axis labels with nested grouping variables

I would like the levels of two different nested grouping variables to appear on separate lines below the plot, and not in the legend. What I have right now is this code: data <- read.table(text = "Group Category Value S1 A 73 S2 A 57 …
pawels
  • 981
  • 1
  • 8
  • 15
40
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
  • 2,850
  • 1
  • 24
  • 32
40
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
  • 55,791
  • 58
  • 236
  • 384
39
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,133
  • 6
  • 23
  • 34
37
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
  • 8,058
  • 7
  • 59
  • 94
32
votes
4 answers

Matplotlib Subplots -- Get Rid of Tick Labels Altogether

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
  • 777
  • 2
  • 8
  • 19
29
votes
4 answers

Python: How to increase/reduce the fontsize of x and y tick labels?

I seem to have a problem in figuring out how to increase or decrease the fontsize of both the x and y tick labels while using matplotlib. I am aware that there is the set_xticklabels(labels, fontdict=None, minor=False, **kwargs) function, but I…
FaCoffee
  • 6,303
  • 19
  • 76
  • 148
1
2 3
88 89