For questions related to the formatting of the x-axis in a plot
Questions tagged [x-axis]
332 questions
1
vote
0 answers
How to combine 2 boxplots with customized x-axis using 3 axes (with matplotlib)
I want to show 2 boxplots on 3 axes. First problem I solved with gently help here.
The first boxplot is plotted with an interrupted x-axes.
Now I want to plot a second boxplot on a 3rd axis. The x-axis should start where the x-axis of ax2 ended.
I…

Kajette
- 47
- 4
1
vote
1 answer
Plotly - change range of x-axis (date)
I managed to change the range in the ggplot, but when passing that plot to plotly it totaly disregarded this.
Goal
I want to pass a long serie from 1996 onwards to plotly, it want the plotly to have all the date in it, but ONLY show a set of the…

Christian
- 117
- 1
- 3
- 10
1
vote
1 answer
double x-axis in R native plot, one for double frequency and the second for Dates
I am using native R plot function to genertae graphics. looking to add a double x-axis on same plot. One holds doubles and the other x-axis holds Date object. I am using the following commands but they dont seem to work.
First…

Ain Soph
- 11
- 1
- 2
1
vote
1 answer
Chance number of digits on the x-axis
I try to plot price agains year. year is formated as integer, but is ploted with one digit. How can I change that? x-axis without digit.
df looks like this:
now I use this code to plot:
ggplot(df, aes(Jahr, Energiepreis)) + geom_line()
plot looks…

Alex Auf der Maur
- 13
- 4
1
vote
2 answers
How do I plot ISO week numbers from two contiguous years in my x axis?
I have a data.frame of the last 4 weeks and the first 4 weeks of 2022 and 2023. I'm looking to create a bar plot where my x-axis displays the last weeks of 2022 and then the first weeks of 2023. However, ggplot automatically sorts the week numbers…

Sergio Escalante
- 219
- 1
- 2
- 6
1
vote
1 answer
Fill vertical areas with datetime xaxis matplotlib
I try to fill vertical areas at certain years. Ideally, I want to vertical gray areas at positions from Jan 2000 to May 2000, from Dec 2003 to May 2004, from Dec 2004-May 2005, the same for 2010, 2016 and 2020. However, I have to do it mannually and…

Tuyen
- 977
- 1
- 8
- 23
1
vote
1 answer
Shifting start position of X Axis of line chart
I want to shift the start position of the red line from "FEB-2020" to "JAN-2021". Currently this is my code and a picture of my current output. Basically Shorten the period of the whole graph to the dates stated above.
# plot daily vaccinated
fig,…

frank888
- 13
- 4
1
vote
1 answer
Plot elements in a column of a dataframe on the same graph sharing the same x-axis in datetime format
I have a dataframe:
Element Date Q
0 A 24/10/2021 17:16 400
1 B 24/10/2021 18:59 210
2 A 26/10/2021 18:42 325
3 A 26/10/2021 19:44 589
4 B 29/10/2021 14:23 251
5 A …

Karl.os
- 11
- 2
1
vote
1 answer
axis numbers fall outside of the lattice plot in R
When I plot my lattice graph, the x-axis value of 100000 falls outside of the plot. I don't want to make the number size smaller. Anything I could do to make this work?
code:
bwplot(dfmh2$Period~dfmh2$Intensity|dfmh2$microhabitat, #temperature…

Laura Schefold
- 47
- 7
1
vote
1 answer
Make navigation bar disappear when window gets smaller
I've built my website from scratch using HTMl and CSS. I want to have separated sections. A navigation bar and a main section. The navigation bar should scroll with the window when scrolling on the y axis. I managed to do that with CSS "position:…

Femic
- 13
- 3
1
vote
1 answer
change axis ticks in line plot
I have been trying to do the next task but without success.
t<-seq(1,5)
y1<-c(0.3,0.25,0.35,0.2,0.4)
data<-data.frame(t,y1)
ggplot(data,aes(x=t,y=y1)) +
geom_line(color="red") + geom_line(aes(x=t,y=y1+0.2),color="blue")+
…

user3483060
- 337
- 2
- 13
1
vote
0 answers
Excel: Plot time series with only y values with positional x values (first y value is x=1, second y value is x=2, and so on) converted to time unit
In Excel I would like to plot a time series with only y values, which is possible with simply selecting the y values of a time series. In that case Excel matches the y value to a positional x value (see title of question).
The Question is: Is it…
1
vote
1 answer
Order months on the x axis
I need to create a graph, which should be ordered chronologically according to the column Variac_2019.
Nonetheless, I want the x axis to be labelled as the column Mes1_Any. The problem is data RStudio is ordering the x axis alphabetically:
How can…

Maria
- 173
- 7
1
vote
0 answers
Display x-axis for each subplot when faceting with facet_grid
I've got a facet_grid plot with 8 subplots. I set the scale for the y axis as "free_y" while I need the x axis to be the same for each subplot. My issue is that, while every y-axis is shown, only three of the subplots show their x-axis.
here is my…

Devon
- 17
- 3
1
vote
2 answers
Reducing the number of labels on x-axis of plot
Im learning matplotlib, and trying to draw a simple scatter plot that has dates on the x-axis and values on the y. There are 2200 dates, from 2004 to 2019, (format 2014-09-17 type O).
Heres my…

AndysPythonStuff
- 75
- 8