For plotting questions related to adjusting the y-axis.
Questions tagged [yaxis]
528 questions
4
votes
3 answers
Chart.js How to change y axis title position
I am working with the chart.js library to create a graph and I am almost done. One of the last things is to position the title of the yAxis to the top just under the legend.
I currently have something like…

Tajlang
- 41
- 1
- 5
4
votes
1 answer
automatically adjust axis limits while plotting separate plots together
I would like to automatically adjust the ggplot graphs while plotting side-by-side.
library(ggplot2)
library(gridExtra)
set.seed(123)
freq <- sample(1:10, 7, replace = T)
labels <- c('AUS', 'NZ', 'ENG', 'SOC', 'PAK', 'SRI', 'IND')
value <-…

Prradep
- 5,506
- 5
- 43
- 84
4
votes
2 answers
Y-break with scale change in R
I am still new to R. I agreed to help a friend replot his graphs however one of his plot designs is proving quite hard to reproduce. This is because he inserted a Y-axis break followed by a scale alteration on a barplot. This is illustrated by the…

Scientist
- 1,061
- 2
- 13
- 30
4
votes
1 answer
How to add more Y-axes to MSChart with different scale at left or right side
I want to add 3 Y-axes for the chart with different scales.
I want to get one x axis and different y axis. I did it like below code but I want to show one y axis like in the 2nd image that I attached..
My C# code so far:
private void…

SNP
- 51
- 1
- 10
4
votes
2 answers
How to set limit range
Why doesn't matplotlib.pyplot.xlim() method work in the below example?
import matplotlib.pyplot as plt
l = [0,0.2,0.4,0.6,0.8,1.0]
plt.plot(l,l)
plt.xlim = (-10,10)
plt.show()

Denis Kuzin
- 863
- 2
- 10
- 18
4
votes
2 answers
ggplot2: How to end y-axis on a tick mark?
I am making several different plots with different axis ranges, so this question does not apply to only the code I am showing here. I tried modifying the breaks and intervals of tick marks, but for some plots the y-axis always continues after the…

Jon
- 591
- 2
- 8
- 19
3
votes
1 answer
matplotlib supylabel on second axis of multiplot
I'm not finding it possible to add a second supylabel for a right-hand y-axis of a multiplot.
Can anyone please confirm 1) whether or not it can be done and/or 2)provide guidance on how?
I am trying to achieve this:
Because there are a variable…

CreekGeek
- 1,809
- 2
- 14
- 24
3
votes
1 answer
Force y axis to start at 0 and still use automated labeling
I have a plot whose y min starts well above 0. But I want to include 0 as the min of the y-axis and still have Stata automatically create evenly-spaced y-axis labels.
Here is the baseline:
sysuse auto2, clear
scatter turn displacement
This…

bill999
- 2,147
- 8
- 51
- 103
3
votes
1 answer
How to change the limits from scale_y_continuous depending on the plot in R?
I want to draw boxplots with the number of observations on top. The problem is that depending on the information and the outliers, the y-axis changes. For that reason, I want to change the limits of scale_y_continuous automatically. Is it possible…

emr2
- 1,436
- 7
- 23
3
votes
2 answers
Plot on primary and secondary x and y axis with a reversed y axis
I have created this plot where I have "observed E. coli" on the the left side "y axis", "modelled E. coli" on the right side "y axis" and "dates" on the "x axis".
The code is this
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot…

Phil
- 88
- 8
3
votes
1 answer
center object on y axis that is connected to pan gesture
I want my swift code to center a frame connected to a uipangesture to the y axis. You can see what I am looking for in the gif I created below. Right now I have figure out a way to do this. I found you can do something similar to this using…

Sam Burns
- 65
- 1
- 10
3
votes
1 answer
Latex in y-axis title in plotly not working
Can you please tell me why fig.update_yaxes(title=dict(text="$\text{This is a test:} \sqrt{2^4}$") does not work in the following code
import plotly.express as px
fig = px.bar(df, x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
…

hans
- 323
- 1
- 14
3
votes
1 answer
How can I plot a secondary y-axis with seaborn's barplot?
I'm trying to plot the data (see below). With company_name on the x-axis, status_mission_2_y on the y axis and percentage on the other y_axis. I have tried using the twinx() fucntion but I can't get it to work.
Please can you help? Thanks in…

johnadem
- 153
- 2
- 12
3
votes
2 answers
label y axis with a different column in ggplot2
Using ggplot2, I want to create a plot with a variable as my y-axis, but a different variable for the y-axis label
Take this sample data:
df <- data_frame(
YearMonth = c("2018-01", "2018-01", "2018-02", "2018-02", "2018-03", "2018-03", "2018-04",…

perkot
- 121
- 1
- 10
3
votes
2 answers
How can I set the y-axes to the same scale for a multi-plot grid in plotly python
I have a csv file with performance metrics and in order to plot CPU Load per week for a 4 week period, I use a multi-plot plotly package in python. Here's the code below. The problem is the load varies each week and the y-axis is different for each…

py_noob
- 433
- 2
- 8
- 17