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
29
votes
2 answers

Show decimal places and scientific notation on the axis of a matplotlib plot

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
  • 295
  • 1
  • 3
  • 4
28
votes
6 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,178
  • 1
  • 15
  • 25
28
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
  • 3,581
  • 11
  • 28
  • 36
27
votes
1 answer

How to display all label values in matplotlib?

I have two lists, when I plot with the following code, the x axis only shows up to 12 (max is 15). May I know how can I show all of the values in x list to the x axis? Thanks in advance. x = [4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3] y =…
Kevin
  • 1,771
  • 9
  • 29
  • 46
26
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
  • 3,625
  • 7
  • 32
  • 50
25
votes
2 answers

Google Chart Tools truncating y axis labels

Working with a Google bar chart, here is what I got: Here my custom options var options = { width: 500, height: 240, legend : 'none', vAxis:{title:'Answers',textStyle:{color: '#005500',fontSize: '12', paddingRight: '100',marginRight:…
Junior Mayhé
  • 15,301
  • 26
  • 105
  • 157
25
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,227
  • 3
  • 29
  • 49
23
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,219
  • 5
  • 22
  • 34
23
votes
1 answer

d3.js axis labels - color not changing

I'm creating my axis with the following text, however the color of the labels is not changing properly; the color the text remains black. Does anybody know why? // create Axis svg.selectAll(".axis") .data(d3.range(angle.domain()[1])) …
Mobie
  • 1,600
  • 4
  • 16
  • 24
22
votes
3 answers

Matplotlib - hiding specific ticks on x-axis

I am trying to hide the first and last x-axis tick text of my bar plot, which is '2004' and '2013'. Matplotlib automatically adds these in by default, even though my dataset is for 2005 to 2012, hence I'd prefer not to have 2004 and 2013 in my bar…
Osmond Bishop
  • 5,510
  • 10
  • 36
  • 47
22
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
  • 597
  • 1
  • 4
  • 13
20
votes
1 answer

How do I make my axis ticks face Inwards in ggplot2

I have made a barplot using ggplot2 and the Journal I need to submit to requires that the axis ticks face inwards. This is the text representation of my data (dput) Mean.Inc.melt<-structure(list(Var1 = structure(c(1L, 2L, 1L, 2L, 1L, 2L), .Label =…
Mismedolee
  • 303
  • 1
  • 2
  • 6
19
votes
4 answers

Matplotlib: Add strings as custom x-ticks but also keep existing (numeric) tick labels? Alternatives to matplotlib.pyplot.annotate?

I am trying to produce a graph and I am having some issues annotating it. My graph has a log scale on the x-axis, showing time. What I want to be able to do is keep the existing (but not predictable) numeric tick labels at 100 units, 1000 units,…
FakeDIY
  • 1,405
  • 2
  • 14
  • 22
18
votes
2 answers

How can you create a box around an axis tick label in ggplot2?

For several reasons, I am trying to duplicate the grotesque plot shown below. It violates many precepts of good data visualization so for training purposes my goal is to use ggplot2 and deconstruct it -- remove or revise poorly-chosen features one…
lawyeR
  • 6,804
  • 3
  • 23
  • 56
17
votes
3 answers

How to align axis label to the right or top in matplotlib?

By default matplotlib plots the axis label at the center of the axis. I would like to move the label in such way that it is aligned with the end of the axis, both for the horizontal and vertical axis. For example for the horizontal axis I would like…
Ruggero Turra
  • 14,523
  • 14
  • 72
  • 123
1
2
3
88 89