Questions tagged [yaxis]
360 questions
127
votes
6 answers
How can I plot with 2 different y-axes?
I would like superimpose two scatter plots in R so that each set of points has its own (different) y-axis (i.e., in positions 2 and 4 on the figure) but the points appear superimposed on the same figure.
Is it possible to do this with plot?
Edit…
![](../../users/profiles/686481.webp)
DQdlM
- 8,494
- 13
- 34
- 34
19
votes
1 answer
Combining Bar and Line chart (double axis) in ggplot2
I have double-y-axis chart made in Excel. In Excel it requires only basic skills. What I'd like to do is to replicate this chart using the ggplot2 library in R.
I have already done this, but I need to plot Response on 2nd-y-axis.
I enclose…
![](../../users/profiles/2969277.webp)
AK47
- 1,148
- 4
- 14
- 30
9
votes
1 answer
Adding second Y axis on ggplotly
I have created the following dataframe object and graph using plotly and ggplot
library(ggplot2)
library(plotly)
rdate <- function(x,
min = paste0(format(Sys.Date(), '%Y'), '-01-01'),
max = paste0(format(Sys.Date(),…
![](../../users/profiles/9091991.webp)
Raghavan vmvs
- 987
- 1
- 7
- 20
8
votes
5 answers
How to hide y axis?
I plot a horizontal boxplot in MATLAB -- boxplot(y, group,'orientation','horizontal'), and then hide the y-axis using set(gca,'box','off','ycolor','w').
It looks fine on the screen - only the bottom x-axis is visible. But whenever I save the figure…
![](../../users/profiles/861988.webp)
Rory
- 341
- 1
- 5
- 14
7
votes
1 answer
Plotly: How to plot on secondary y-Axis with plotly express
How do I utilize plotly.express to plot multiple lines on two yaxis out of one Pandas dataframe?
I find this very useful to plot all columns containing a specific substring:
fig = px.line(df, y=df.filter(regex="Linear").columns,…
![](../../users/profiles/2735959.webp)
derflo
- 361
- 2
- 7
7
votes
2 answers
How to reverse secondary continuous_y_axis in ggplot2
I have a dataset I would like to graph with two Y-axes. The would like to reverse the secondary Y-axis so that it runs -60 to -40. The primary Y-axis should run 300-550. I cannot figure out how to reverse the secondary Y-axis without reversing the…
![](../../users/profiles/9488451.webp)
Christopher
- 73
- 5
7
votes
2 answers
ggplot2 (Barplot + LinePlot) - Dual Y axis
I am having a really hard time recreating an excel example with ggplot2. I have tried numerous examples but for some reason I cannot reach my desired result. Can someone please have a look at my example?
df <- structure(list(OccuranceCT = c(4825,…
![](../../users/profiles/8050298.webp)
Cosmin
- 513
- 6
- 25
6
votes
2 answers
ggplot: Boxplot by several categorical variables
I am trying to plot several boxplots in one chart using ggplot2. I have 1 continuous variable and several factors. I would like to have a single Y axis and each pair of boxplots to have their own x axis with their own factor levels. So far, I tried…
![](../../users/profiles/2053921.webp)
user2053921
- 63
- 1
- 4
6
votes
1 answer
Matplotlib: imshow with second y axis
I'm trying to plot a two-dimensional array in matplotlib using imshow(), and overlay it with a scatterplot on a second y axis.
oneDim = np.array([0.5,1,2.5,3.7])
twoDim = np.random.rand(8,4)
plt.figure()
ax1 = plt.gca()
ax1.imshow(twoDim,…
![](../../users/profiles/940293.webp)
Chris
- 651
- 7
- 23
5
votes
2 answers
Multiple y axis for bar plot and line graph using ggplot
I have some transpiration data from an experiment that I would like to show as a time series on a line graph using R. I also have some precipitation data which I would like to show on the same graph as a bar plot. I've been able to do this using R's…
![](../../users/profiles/8045827.webp)
A.Benson
- 411
- 4
- 11
5
votes
1 answer
R | ggplot2 | (remove tick marks + remove panel border) but keep axis lines
novice user here so please be kind and gentle! :)
I am dealing with the following dataset and R script:
#Create pvalue ranges
pvalue <- c(".000 - .005",".005 - .010",".010 - .015",".015 - .020",".020 - .025",".025 - .030",".030 - .035",".035 -…
![](../../users/profiles/6801861.webp)
James F
- 55
- 1
- 1
- 5
5
votes
3 answers
Highcharts Plot Reciprocal Values For Column Height
I am trying to plot a categorical multi axis column chart of rankings. The number 1 ranking should be the tallest column and lowest ranking the shortest.
Essentially I would like the height of the bar to be it's reciprocal.
It is very close…
![](../../users/profiles/55124.webp)
Bryan
- 15,409
- 22
- 92
- 119
4
votes
1 answer
Error "NAs are not allowed in subscripted assignments" while using Squash_axis in ggplot2, with dataset without NA-values
I want to skip part of my y-axis for a dataset with most values between -10 and 100, and then a few at 400 again. So I want to squeeze this empty area. I already am using facet grid in my plot for 3 different scenario's, so I would prefer to just…
![](../../users/profiles/10891145.webp)
Marretje Adriaanse
- 139
- 1
- 7
4
votes
1 answer
Number of Active Sessions in Tomcat
I have my web services jar file deployed under webapps\nyx\WEB-INF\services in my tomcat server. Now I am trying to get no of active sessions using below code inside a web service method.
MBeanServer mBeanServer =…
![](../../users/profiles/4886416.webp)
Shelly
- 681
- 4
- 20
4
votes
1 answer
ggplot2 facet_grid create panels on the y-axis
I have similar data like the following example:
dat1 <- data.frame(group=c("a", "a","a", "a","a","a","b","b","b","b","b", "b", "b","b","b","c","c","c","c","c","c"),
subgroup=c(paste0("R", rep(1:6)),paste0("R",…