For questions related to the formatting of the x-axis in a plot
Questions tagged [x-axis]
332 questions
0
votes
0 answers
Irregular dates on x-axis should create matching spaces between them
I have a set of data which is measured waterflow of wells over a period of years with infrequent dates of measurements.
I made a code which nearly does what i want, but the spacing on the x-axis should correlate to the infrequent dates of…

Jürgen L
- 1
- 1
0
votes
1 answer
How to reverse order of x-axis breaks in ggplot?
I'm trying to make a plot wherein large values on the x-axis are actually small, and vice versa. Because of how ggplot reads the data, it's automatically ordering the data such that the x-axis is ordered smallest to largest, and I'm trying to figure…

MadelineJC
- 97
- 7
0
votes
0 answers
Changing X-Axis labels from numbers to characters
Right now I have a graph that is displaying the months as numbers 01,02, …, and I would like to change them into the actual month name. I used this code but get a discrete value error each time.
scale_x_continuous(breaks =…

Emily Bingham
- 1
- 1
0
votes
2 answers
Order x-axis categorical variable using another categorical variable
I have a dataframe like follows:
Class ID Stage Abundance Substrat
OTUA rep1 A-X1 123 G
OTUA rep2 A-X1 234 PC
OTUA rep3 A-X1 [numerical values] [only two categorical…
0
votes
1 answer
Shift histogram x axis bar start and end (from july to june)
I would like to change the start and end month on my histogram so I can see the bars followed: November, December, January, February an March.
The idea is start the hist.plot from month 7 and end in 6 (for example).
My code is something like this:
d…

Azar_y_Kaos
- 1
- 1
0
votes
1 answer
Plotly graph : show number of occurrences in bar-chart
I try to plot a bar-chart from a givin dataframe.
x-axis = dates
y-axis = number of occurences for each month
The result should be a barchart. Each x is an occurrence.
x
xx
x
2020-1
2020-2
2020-3
2020-4
2020-5
I tried but don't get…

Marvy
- 87
- 6
0
votes
1 answer
Changing the x lables using ggplot2 in R
I have this data and plot it using a bar plot. I want to change the x labels to make it simple,
data_bayes <- read.table(text="
Estimation,Cell types,Total
No rank,Cell type 0 ,3468
No rank,Cell type 1 ,3468
No rank,Cell type 2 ,3468
No rank,Cell…

MK Huda
- 605
- 1
- 6
- 16
0
votes
0 answers
Line chart point not aligned with x axis ticks D3.js
Hi I have a line graph but the point indicated by the line aren't aligned with the x axis points, they seem to be in-between the points.
Anyone know that the cause could be and how to fix it?
I have added my code for this graph below. Please note…

JoeXYZ
- 47
- 6
0
votes
1 answer
Histogram using scale_x_continuous() to start from 0
I'm trying to create a histogram with tick marks at each bar. However, when I use scale_x_continuous(), the x-axis adjusted to the lowest number, which happens to be not 0. How can I make the x-axis start from 0? I tried x_lim(0,20) but it got…

Tim
- 81
- 6
0
votes
1 answer
Remove the gap and avoid overlapping xaxis and yaxis ticklabels
I'm developing a visualization chart:
But as you can see:
1 - It has a gap at the start and end of the chart
2 - The tick labels are overlapping
I tried a lot to fix it but I can't find references and I don't know more about what I should try...…

Leonardo Ferreira
- 673
- 1
- 6
- 22
0
votes
1 answer
Date on X-Axis in wavelets
I am using daily time series data of 492 observations and three variables, (date, d, r). I want to print dates as 01/2020, 06/2020, 01/2021, 06/2021, 01/2022, 06/2022, on X-axis in partial and cross wavelet coherence plots. I am using this code. I…

Rashid Ali
- 1
- 1
0
votes
0 answers
R; package {stats}; function {ts.plot}; change x-axis labeles
I need to change the x-axis labels so they are words instead of numerals. Currently, the x-axis goes 1, 2, 3, etc. I would like it to go "Placement", "Fresh", etc.
trendplot <- function(timeseries, color, index, first = FALSE, w = 4, add_main =…

vmc333
- 1
- 1
0
votes
1 answer
pd.read_csv, when changing separator data type changes?
My dataframe is originally a text file, where the columns are separated by a tab.
I first changed these tabs to spaces by hand (sep=" "), loaded and plotted the data, my plot looked the way it should.
Since I have multiple files to plot, its not…

Veronika
- 1
0
votes
1 answer
Setting X axis label name more frequently in Matplotlib
I have a dataframe like this
Time(DDHHMM) True AOG Predicted AOG
5184 28:0:0.0 4.0 4.697324
5185 28:0:5.0 10.0 0.366948
5186 28:0:10.0 6.0 6.158011
5187 28:0:15.0 9.0 8.388459
5188 …

Jewel_R
- 126
- 2
- 17
0
votes
1 answer
How do I extend the x axis with string values and draw a rectangle in ggplot2? R
I would like to add two more values (1 and 5000) on the x-axis and draw a rectangle using something like:
geom_rect(aes(xmin = 1,
xmax = 5000,
ymin = -Inf, ymax = Inf))
Is there a way to do it keeping the x-axis values…

Ylenia Rotalinti
- 5
- 1