For questions related to the formatting of the x-axis in a plot
Questions tagged [x-axis]
332 questions
0
votes
1 answer
Dynamically add x-axis in React using ChartJS
I want to add another x axis to my ChartJS which works, but the scales do not separate, for example I want one label on the x-axis with 0-9 and another one 0-16 to show separately. It works perfectly fine for the y-axis but not for the x-axis.
Now…

TheDarkHunter
- 31
- 6
0
votes
0 answers
ggplot: How do I select data above a certain threshold but still display the correct percentage
I would like to plot ordinal data and display the percentage of each ordinal value on the y axis. However, I only want to plot data above a certain threshold. So I have a df with the variable "Liking of cats" which is on a 1-5 Likert scale, and I…

ag123987
- 1
0
votes
1 answer
Add a vertical dash and dash line to a LineChart (mpandroidchart)
Label done with ValueFormatter.
LineChart with:
chart.xAxis.setDrawGridLinesBehindData(false)
Makes a line to the whole Y Axis.
I need something like that. I think I've tried everything.

Artem Winokurov
- 182
- 2
- 12
0
votes
1 answer
How to make specific variable order on geom_col X axis within each Y variable subgroup
I am trying to make specific X axis order within each Y variable on geom_col graph. I have found solutions with factor and it's levels, but it doesn't seem to work for me.
Here is data frame 'df_full':
df_full<-data.frame(conc=c(NK, 1 µM X, 1 µM, 10…

Simona
- 87
- 2
- 8
0
votes
0 answers
Add minor tick marks to Bayesian change point plot
I have drawn a plot using the Bayesian change point, and I need to add a minor tickmark to the x-axis. Can anyone help me?
Here are my codes:
df<-read.csv("Temp.csv")
x <- df.ts
bcp_x <- bcp(x, return.mcmc = TRUE)
plot(bcp_x)
[

Mitra
- 1
0
votes
1 answer
Problem with the order of the x-axis in my plot
I have a problem with the order of the x-axis in my plot.
Download the data from the website of the Central Bank of Perú (GDP by quarter).
library(jsonlite)
library(rstudioapi)
library(ggplot2)
library(data.table)
PBI <- "PN02635BQ"
URL3 <-…

Armando Delgado
- 13
- 2
0
votes
2 answers
There are more factors than what I have in the X axis being labeled
I am plotting a simple violin plot that shows violins of a variable for 2 years, so i just need the "2017" and "2018" to appear in the X axis, but more tick marks are appearing, from 2016.5, 2017.0, 2017.5... until 2018.5. In the "year" column in my…

Pablo Tovar
- 3
- 1
0
votes
1 answer
Plotting geom_vline() on factorized x-axis
Update
I managed to get the vline to show by doing as @danlooo suggested,
geom_vline(aes(xintercept= 4.7) # 4.7 is the rough position of the first value in VLineValues <- c(25, 26, 27), between level 12 & 40 (also position 4 and 5)
However, since…

Norruas
- 61
- 1
- 9
0
votes
2 answers
Subplots in Python with x axis having too large of a jump between values
import matplotlib.pyplot as plt
import numpy as np
delta = 0.0001
t = np.arange(0,5+delta,delta)
xt = np.sin(np.pi*t)
fig = plt.figure(1)
ax1= plt.subplot(3,2,1)
ax1.plot(t,xt, "tab:red")
ax1.set(ylabel = "Amplitude")
ax1.set(xlabel =…

MolliMm
- 3
- 1
0
votes
0 answers
How do I set my date correctly in Matplotlib?
The year on the x-axis is incorrect; the table format is YY-MM-DD. Which part of the code do I miss? Could you please make a suggestion?
date new_sentiment count
0 2020-03-06 POSITIVE 1
1 2020-03-17 NEGATIVE 2
2 2020-03-18 …

tassaneel
- 175
- 2
- 14
0
votes
1 answer
How to reverse x-axis in box-plot
People, please can you evaluate my code and give me a hand?
I need to reverse de X-axis of my box-plot, as you can see, the x-axis is the age in Ma, R plot the values in ascending range and I need them in the reverse form (ie 65-64, 64 -63, 63-62,…

Batman
- 13
- 2
0
votes
1 answer
Controlling X axis values in ggplot ridgeline graph
I have overlaid density plots (of boys vs girls) in a ridgeline density plot. The X axis values are whole numbers ranging from 1 to 9 but in the density plot they are smoothed to go from 0 to 10. Also the X axis displays decimal values such as 2.5…

user2450223
- 235
- 2
- 10
0
votes
1 answer
ggplot2: unable to sort x axis based on custom ordering of factor variable
I am trying to create a bar plot with custom ordering of x axis (factor variable). After searching around for about 3 hours, I think I should ask for help directly.
library(dplyr)
library(ggplot2)
library(stringr)
library(extrafont)…

Shakir
- 343
- 5
- 23
0
votes
0 answers
How to make ggplot2 stacked barplot not re-arrange x-axis and follow order of original data table
I am trying to keep geombar from rearranging the x-axis on my stacked barplot.
Data frame looks like this:
I want to follow that same order for the group column (Female: HIV negative, Male: HIV negative, Female: HIV untreated, Male: HIV untreated,…

jan.narv
- 11
- 1
0
votes
1 answer
plt.plot: X axis problem when plotting line in Python
i encounter a problem when plotting the graph in Python using plt.
The X axis value didnt match the index value at all and start from zero, i would like the x axis show 2009-03/2009-04 etc instead of starting from zero.
Here is my data…

Python Rookie
- 11
- 2