Questions tagged [yaxis]
360 questions
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…
![](../../users/profiles/10664750.webp)
Dustin
- 89
- 8
2
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"],
…
![](../../users/profiles/14672356.webp)
hans
- 95
- 7
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…
![](../../users/profiles/9829297.webp)
DMC
- 53
- 7
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')
…
![](../../users/profiles/12409129.webp)
Abdulkadir Arslan
- 65
- 5
2
votes
1 answer
Free y axis in only some subplots with facet_wrap
I am trying to plot three different subplots within the same graphic using facet_wrap. I know the y axis can be settled "free" or "fixed" with the argument scales of facet_wrap(). However, due to the characteristics of my data, I would like to keep…
![](../../users/profiles/13425901.webp)
Javier
- 385
- 1
- 9
2
votes
0 answers
Dual y-axis on subplots
I would like to create 3 stack subplots with dual y-axis on each subplot. Using the following code gives me a ValueError: too many values to unpack (expected 2). A bit lost on this and would appreciate some help. Thank you!
fig, (axes, axes1) =…
![](../../users/profiles/13527860.webp)
filippa225
- 21
- 3
2
votes
1 answer
ggplot graph with double y-axis
I'm trying to make a graph with a double y-axis.
My data looks like this:
year variable value
1 2009 Letselongevallen 4455
2 2010 Letselongevallen 4337
3 2011 Letselongevallen 4710
4 2012 …
![](../../users/profiles/13727374.webp)
Freya Slootmans
- 37
- 3
2
votes
1 answer
Add boxes with descriptive annotations to y-axis in ggplot2
I"M trying to add another label or description to my Y axis. I attached a picture for reference for what I'm trying to accomplish. I can't find anything that describes how to add additional elements to an axis. It the "Good" and "Bad" boxes…
![](../../users/profiles/13583205.webp)
TER
- 95
- 5
2
votes
2 answers
ggplot2 - two or more lines on y axis title
I need two or more lines of text on my y-axis title. However, the title is cut off if I have multiple lines. Anyway I can work around this?
ggplot(iris,aes(Sepal.Length, Sepal.Width)) +geom_line()+labs(y=expression(paste("line 1 \nline2")))
![](../../users/profiles/6475475.webp)
Bubs
- 85
- 1
- 1
- 9
2
votes
1 answer
Is it possible to zoom vertical axis on Flutter Charts?
I am trying to familiarize with charts in Flutter, using github.com/google/charts package.
I want to make a chart (bar, line, scatter or any other.. this, for example) where I can zoom and pan not only the x-axis, but also the vertical y-axis…
![](../../users/profiles/3302886.webp)
Karlooie
- 143
- 1
- 6
2
votes
1 answer
How to format Matplotlib secondary y-axis datetime values
I am attempting to plot a line graph superimposed on a bar graph using matplotlib. The data has plotted correctly, however, the secondary y-axis describing the forecasted start time is being output incorrectly. All values for Forecasted Start Time…
![](../../users/profiles/11871442.webp)
Nathan Rick
- 43
- 7
2
votes
1 answer
Matplotlib: How to assign correct y-axis scale to data?
I can create this plot:
import matplotlib.pyplot as plt
x = range(1, 16)
zero = [0] * 15
pointfive = [0.5] * 15
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.plot(x, days, 'moccasin')
ax1.set_ylabel('days', color='moccasin')
ax2 =…
![](../../users/profiles/7945506.webp)
Julian
- 511
- 3
- 9
2
votes
0 answers
Set log plot limits to next lowest/highest decade
I've got a function that creates a log-log plot using Matplotlib.
import matplotlib.pyplot as plt
plt.loglog(xdata, ydata, label="function label...")
# ...more plots
plt.set_xlabel("Frequency (Hz)")
plt.show()
I'd like to have Matplotlib plot one…
![](../../users/profiles/2251982.webp)
Sean
- 1,080
- 9
- 21
2
votes
0 answers
Why matplotlib subplots does not show xtick labels when second y-axis is added?
Why matplotlib subplots does not show x-tick labels when second y-axis is added? It only shows x-tick labels for the last subplot! When I comment ax2=ax.twinx(), it will show x-tick labels, but I need the second y-label as well!
n_subplots=2
fig,…
![](../../users/profiles/9945310.webp)
Mohammad
- 51
- 4
2
votes
1 answer
How do I change the y axis on facetgrid python to percentage?
Python matplotlib sns facetgrid y axis question
Hello!
I've been learning about python for data analysis and I'm stuck on something I can't find an answer to.
I want to change the y axis on my sns facegrid chart to a percentage. Below is the code…
![](../../users/profiles/4283143.webp)
OverFlowMars
- 119
- 13