For plotting questions related to adjusting the y-axis.
Questions tagged [yaxis]
528 questions
3
votes
0 answers
How to set the origin of y-axis in geom_bar (ylim does not work)
I am trying to control the range of the y-axis in a bar plot using ggplot. For this graph, I would like to the set the y-axis origin at 1, and not at 0 as ggplot2 does by default.
For this example, lets assume I want to plot the median value for a…

FabF
- 61
- 5
2
votes
1 answer
Plotting a swarmplot on a violinplot changes the ylim and truncates the violins
import seaborn as sns
import numpy as np # for sample data
import pandas as pd
# sample data
np.random.seed(365)
rows = 60
data1 = {'Type 1': ['a'] * rows,
'Total': np.random.normal(loc=25, scale=3, size=rows)}
data2 = {'Type 1': ['b'] *…

Cullen Wise
- 21
- 2
2
votes
0 answers
Discontinuous y-axis in inset plot with `ggplot2`
I am trying to insert a Kaplan-Meier inset "zoom" plot into the same KM plot (when Survival curves are very similar to allow more accurate inspection). This is currently used by many journals. Unfortunately, I find creating an inset plot with a…

q050cr
- 21
- 3
2
votes
2 answers
Force individual y axis limits
I have this dataframe:
df <- structure(list(x = c(2L, 3L, 4L, 5L, 1L), y = c(24L, 27L, 18L,
23L, 28L)), class = "data.frame", row.names = c("1", "2", "3",
"4", "5"))
x y
1 2 24
2 3 27
3 4 18
4 5 23
5 1 28
I want to set the y axis limits to 0…

TarJae
- 72,363
- 6
- 19
- 66
2
votes
1 answer
How can you force a ggbarplot ylimits?
I'd like my graph to start at y=0. Hence, all bars with a zero value should not be shown in the figure. However, bars with zero values are showing in my graph as if they had a negative value. See
.
This is the data series used in the…

Thais Jiménez
- 21
- 2
2
votes
1 answer
Sort a Chart from Lowest to Highest Value in Chart JS
I have this starting code and I'm tryng to figure out how I can sort this data from the highest to the lowest. The code can sort correctly the values but the labels in the yAxis are wrong.
I've tried myself but this code is advanced for me to…

Shundo
- 33
- 6
2
votes
1 answer
Setting a fixed amount of y Axis Lines to display on Apache ECharts
I'm trying to show only a certain amount of yAxis Lines in my Apache ECharts Chart.
I tried the following:
yAxis: [
{
type: 'value',
min:0,
max:6000
}
],
yAxis: [
{
type: 'value',
scale:true,
splitNumber:4,
}
],
I need to dislpay it like…

gene_g
- 61
- 1
- 4
2
votes
1 answer
set y-axis range to be +/-10 percentage points of data in R
I am plotting multiple (~300) bar graphs and would like to fix the y-axis range at between +/- 10 percentage points of data in my dataset. Eg: if the y-axis range in my data set is (10,20), I'd like to display the graph rage as (0,30). Any idea how…

user13738818
- 23
- 3
2
votes
1 answer
Altair: multiple y-axes on same chart
I want to know how to make a plot like this (a plot having multiple y-axes), but in altair:

yes
- 241
- 2
- 11
2
votes
0 answers
How to rotate y ticks label from a logarithm scale in dual y scale barplot/plot with matplotlib?
I need some help in order to rotate a secondary yticks label because the following figure below will be presented like a horizontal barplot so I need to rotate all xtick and yticks label at the end. Finally the entire figure will be 90° rotated at…

KR15
- 23
- 4
2
votes
3 answers
R: How to stop rounding percentages to 0 decimal places on plotly chart?
I'm trying to add a plot to my shiny dashboard. The y-axis variable is a proportion and I want to format this as a percentage. I've discovered I can do it using the tickformat feature in the yaxis setting of the layout. However, since the…

Wolff
- 1,051
- 3
- 18
- 31
2
votes
1 answer
How to fit the axis title with two lines in R?
I made one graph with 'two line' y-axis title using the code ylab(expression(paste()
Genotype <- c("CV1","CV2","CV1","CV2")
Category<- c("GN","GN","AGW","AGW")
mean <- c(1.47,1.66,0.98,0.93)
se<- c(0.10,0.20,0.03,0.06)
DataA<-…

Jin.w.Kim
- 599
- 1
- 4
- 15
2
votes
1 answer
Minimize or remove discontinuous axis white spaces or ideally, alter axis scaling - trying to find a solution - R
I have been trying to create a graph that has non-linear (and non-log) based scaling on the axis. Ideally the graph would not be discontinuous. It is hard to explain so I will show it with pictures. My current graph uses a ln transformed scale to…

Dustin
- 139
- 9
2
votes
2 answers
How to plot facets with discontinuous y-axis
I am trying to produce a plot with a discontinuous y-axis but can't get the facet titles to only show once:
Example Data:
data(mpg)
library(ggplot2)
> ggplot(mpg, aes(displ, cty)) +
+ geom_point() +
+ facet_grid(. ~ drv)
After much digging…

DMC
- 63
- 8
2
votes
2 answers
Flipping image across the y axis
I need to write a code that flips the image across y-axis. This code is working but it turns the image to grayscale. I want it to stay in RGB. Lastly, I am not able to use any functions. (imrotate etc.)
subplot(1,2,1);
imshow(A);
title('original')
…

Abdulkadir Arslan
- 75
- 6