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
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é
  • 16,144
  • 26
  • 115
  • 161
25
votes
2 answers

How to prevent scales::percent from adding decimal

This started happening a few days ago, that scales::percent would add a decimal place in its labels, and I can't seem to disable this decimal to display integer values on y-axis. library(dplyr) library(ggplot2) mtcars %>% count(cyl) %>% …
Joe
  • 3,217
  • 3
  • 21
  • 37
25
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
  • 7,560
  • 14
  • 42
  • 51
24
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 my data Mean.Inc.melt <- data.frame( Var1 = factor(rep(c("Harvest", "Pre-Harvest"), 3)), Var2 = factor(rep(c("Dip A",…
Mismedolee
  • 343
  • 1
  • 2
  • 6
24
votes
1 answer

Curve Fitting to a time series in the format 'datetime'?

Here is my problem: polyfit does not take datetime values, so that I converted datetime with mktime producing the polynomial fit works z4 = polyfit(d, y, 3) p4 = poly1d(z4) For the plot however, I would like the datetime description on the axis…
Corins
  • 241
  • 1
  • 2
  • 3
24
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,850
  • 4
  • 19
  • 25
21
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
  • 16,929
  • 16
  • 85
  • 141
20
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,425
  • 2
  • 14
  • 23
18
votes
3 answers

How can I use a graphic imported with grImport as axis tick labels in ggplot2 (using grid functions)?

I'm hoping I can combine the spiffy importing and drawing powers of grImport with the awesome graphing power of ggplot2, but I simply don't understand the grid system well enough to find an elegant way of achieving what I want. What I want is to…
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
  • 7,488
  • 5
  • 33
  • 63
18
votes
6 answers

WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers

I am trying to solve the below issue for last couple of days but still not able to resolve it. I have searched lots of forums but all in vain. *Little bit of history: My code was working well in the devp env but for accessing the production sever I…
Rohit
  • 445
  • 2
  • 7
  • 17
17
votes
1 answer

How do I set label for an already plotted line in matplotlib?

In my code I've already executed ax.plot(x, y, 'b.-', ...) and need to be able to set the label for the corresponding line after the fact, to have the same effect as if I'd ax.plot(x, y, 'b.-', label='lbl', ...) Is there a way to do this in…
orome
  • 45,163
  • 57
  • 202
  • 418
17
votes
3 answers

D3 grouped bar chart: How to rotate the text of x axis ticks?

I'm using the Grouped Bar Chart(http://bl.ocks.org/mbostock/3887051), but the text of the x-axis is very long, as shown in attached picture. How to rotate the text? Thank you.
Linlin
  • 2,127
  • 5
  • 20
  • 25
17
votes
1 answer

Changing format of some axis labels in ggplot2 according to condition

I have a ggplot and I want to highlight only some specific x-axis labels according to a predefined condition. I know that axis text is controlled by theme(axis.text = element_text(...)) but this applies to all labels of the axis. What I want is…
PaoloCrosetto
  • 600
  • 1
  • 7
  • 16
17
votes
4 answers

Mathematical expression in axis label

In R, I use expression(theta[l]) so that the label of my plot axis is that same as $\theta_l$ from LaTeX. For esthetic reasons, I'd rather like to display $\theta_\ell$. Can you help me? EDIT Before, I did plot(1:10, 1:10,…
Marco
  • 9,334
  • 7
  • 33
  • 51