same y-axis but different x-axis graph -
- How I can change this graph, so that I will have one legend but the same size of x and y axis in all three sub-graphs?
Here is my code:
eu <- ggplot(regions_dist6, aes(x=log(pop_density1), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
eu1 <- eu + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
eu2 <- eu1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log Population density '*(p/km^2)*''))
eu3 <- eu2 + labs(size = "% 4-Wheelers") + theme_light()
ed <- ggplot(regions_dist6, aes(x=log(utm44_RoadDens_km_sqkm), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
ed1 <- ed + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
ed2 <- ed1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log Road density '*(km/km^2)*''))
ed3 <- ed2 + labs(size = "% 4-Wheelers") + theme_light()
eg <- ggplot(regions_dist6, aes(x=log(gdp_pc_inr), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
eg1 <- eg + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
eg2 <- eg1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log GDP (₹/c)'))
eg3 <- eg2 + labs(size = "% 4-Wheelers") + theme_light()
grid.newpage()
pushViewport(viewport(layout = grid.layout(1,3)))
print(eu3, vp=viewport(layout.pos.col = 1, layout.pos.row = 1))
print(ed3, vp=viewport(layout.pos.col = 2, layout.pos.row = 1))
print(eg3, vp=viewport(layout.pos.col = 3, layout.pos.row = 1))
Here is data link: 50 observations
https://www.dropbox.com/s/6lrk4a5lo7l2nnj/regions_dist6a.csv?dl=0
r ggplot2 graph
add a comment |
- How I can change this graph, so that I will have one legend but the same size of x and y axis in all three sub-graphs?
Here is my code:
eu <- ggplot(regions_dist6, aes(x=log(pop_density1), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
eu1 <- eu + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
eu2 <- eu1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log Population density '*(p/km^2)*''))
eu3 <- eu2 + labs(size = "% 4-Wheelers") + theme_light()
ed <- ggplot(regions_dist6, aes(x=log(utm44_RoadDens_km_sqkm), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
ed1 <- ed + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
ed2 <- ed1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log Road density '*(km/km^2)*''))
ed3 <- ed2 + labs(size = "% 4-Wheelers") + theme_light()
eg <- ggplot(regions_dist6, aes(x=log(gdp_pc_inr), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
eg1 <- eg + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
eg2 <- eg1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log GDP (₹/c)'))
eg3 <- eg2 + labs(size = "% 4-Wheelers") + theme_light()
grid.newpage()
pushViewport(viewport(layout = grid.layout(1,3)))
print(eu3, vp=viewport(layout.pos.col = 1, layout.pos.row = 1))
print(ed3, vp=viewport(layout.pos.col = 2, layout.pos.row = 1))
print(eg3, vp=viewport(layout.pos.col = 3, layout.pos.row = 1))
Here is data link: 50 observations
https://www.dropbox.com/s/6lrk4a5lo7l2nnj/regions_dist6a.csv?dl=0
r ggplot2 graph
3
Hi! You haven't provided enough information for anyone to help you. At a minimum, you should provide the code used to generate that graph. Better would be a complete reproducible example with data.
– joran
Nov 19 '18 at 20:59
Please provide a MCVE: stackoverflow.com/help/mcve
– Florian
Nov 19 '18 at 21:09
My advice would be to reshape your data so that the three x variables you are plotting are all in one column, with another column labelling what each value represents, and then facet on those labels. But I can' help much more than that without some data to work with.
– joran
Nov 19 '18 at 21:19
Hi, where I can add data?
– S. Ahmad
Nov 19 '18 at 21:49
1
In RStudio(I assume) you should typedput(regions_dist6)
and add the output to your question.
– NelsonGon
Nov 20 '18 at 0:41
add a comment |
- How I can change this graph, so that I will have one legend but the same size of x and y axis in all three sub-graphs?
Here is my code:
eu <- ggplot(regions_dist6, aes(x=log(pop_density1), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
eu1 <- eu + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
eu2 <- eu1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log Population density '*(p/km^2)*''))
eu3 <- eu2 + labs(size = "% 4-Wheelers") + theme_light()
ed <- ggplot(regions_dist6, aes(x=log(utm44_RoadDens_km_sqkm), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
ed1 <- ed + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
ed2 <- ed1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log Road density '*(km/km^2)*''))
ed3 <- ed2 + labs(size = "% 4-Wheelers") + theme_light()
eg <- ggplot(regions_dist6, aes(x=log(gdp_pc_inr), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
eg1 <- eg + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
eg2 <- eg1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log GDP (₹/c)'))
eg3 <- eg2 + labs(size = "% 4-Wheelers") + theme_light()
grid.newpage()
pushViewport(viewport(layout = grid.layout(1,3)))
print(eu3, vp=viewport(layout.pos.col = 1, layout.pos.row = 1))
print(ed3, vp=viewport(layout.pos.col = 2, layout.pos.row = 1))
print(eg3, vp=viewport(layout.pos.col = 3, layout.pos.row = 1))
Here is data link: 50 observations
https://www.dropbox.com/s/6lrk4a5lo7l2nnj/regions_dist6a.csv?dl=0
r ggplot2 graph
- How I can change this graph, so that I will have one legend but the same size of x and y axis in all three sub-graphs?
Here is my code:
eu <- ggplot(regions_dist6, aes(x=log(pop_density1), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
eu1 <- eu + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
eu2 <- eu1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log Population density '*(p/km^2)*''))
eu3 <- eu2 + labs(size = "% 4-Wheelers") + theme_light()
ed <- ggplot(regions_dist6, aes(x=log(utm44_RoadDens_km_sqkm), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
ed1 <- ed + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
ed2 <- ed1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log Road density '*(km/km^2)*''))
ed3 <- ed2 + labs(size = "% 4-Wheelers") + theme_light()
eg <- ggplot(regions_dist6, aes(x=log(gdp_pc_inr), y=log(ET_pc_y))) + geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2)
eg1 <- eg + scale_color_gradient(low="blue", high="red", name = "% Urbanization")
eg2 <- eg1 + geom_smooth(span = .95) + ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
xlab (bquote('log GDP (₹/c)'))
eg3 <- eg2 + labs(size = "% 4-Wheelers") + theme_light()
grid.newpage()
pushViewport(viewport(layout = grid.layout(1,3)))
print(eu3, vp=viewport(layout.pos.col = 1, layout.pos.row = 1))
print(ed3, vp=viewport(layout.pos.col = 2, layout.pos.row = 1))
print(eg3, vp=viewport(layout.pos.col = 3, layout.pos.row = 1))
Here is data link: 50 observations
https://www.dropbox.com/s/6lrk4a5lo7l2nnj/regions_dist6a.csv?dl=0
r ggplot2 graph
r ggplot2 graph
edited Nov 22 '18 at 17:51
Mr. T
4,18791535
4,18791535
asked Nov 19 '18 at 20:56
S. AhmadS. Ahmad
82
82
3
Hi! You haven't provided enough information for anyone to help you. At a minimum, you should provide the code used to generate that graph. Better would be a complete reproducible example with data.
– joran
Nov 19 '18 at 20:59
Please provide a MCVE: stackoverflow.com/help/mcve
– Florian
Nov 19 '18 at 21:09
My advice would be to reshape your data so that the three x variables you are plotting are all in one column, with another column labelling what each value represents, and then facet on those labels. But I can' help much more than that without some data to work with.
– joran
Nov 19 '18 at 21:19
Hi, where I can add data?
– S. Ahmad
Nov 19 '18 at 21:49
1
In RStudio(I assume) you should typedput(regions_dist6)
and add the output to your question.
– NelsonGon
Nov 20 '18 at 0:41
add a comment |
3
Hi! You haven't provided enough information for anyone to help you. At a minimum, you should provide the code used to generate that graph. Better would be a complete reproducible example with data.
– joran
Nov 19 '18 at 20:59
Please provide a MCVE: stackoverflow.com/help/mcve
– Florian
Nov 19 '18 at 21:09
My advice would be to reshape your data so that the three x variables you are plotting are all in one column, with another column labelling what each value represents, and then facet on those labels. But I can' help much more than that without some data to work with.
– joran
Nov 19 '18 at 21:19
Hi, where I can add data?
– S. Ahmad
Nov 19 '18 at 21:49
1
In RStudio(I assume) you should typedput(regions_dist6)
and add the output to your question.
– NelsonGon
Nov 20 '18 at 0:41
3
3
Hi! You haven't provided enough information for anyone to help you. At a minimum, you should provide the code used to generate that graph. Better would be a complete reproducible example with data.
– joran
Nov 19 '18 at 20:59
Hi! You haven't provided enough information for anyone to help you. At a minimum, you should provide the code used to generate that graph. Better would be a complete reproducible example with data.
– joran
Nov 19 '18 at 20:59
Please provide a MCVE: stackoverflow.com/help/mcve
– Florian
Nov 19 '18 at 21:09
Please provide a MCVE: stackoverflow.com/help/mcve
– Florian
Nov 19 '18 at 21:09
My advice would be to reshape your data so that the three x variables you are plotting are all in one column, with another column labelling what each value represents, and then facet on those labels. But I can' help much more than that without some data to work with.
– joran
Nov 19 '18 at 21:19
My advice would be to reshape your data so that the three x variables you are plotting are all in one column, with another column labelling what each value represents, and then facet on those labels. But I can' help much more than that without some data to work with.
– joran
Nov 19 '18 at 21:19
Hi, where I can add data?
– S. Ahmad
Nov 19 '18 at 21:49
Hi, where I can add data?
– S. Ahmad
Nov 19 '18 at 21:49
1
1
In RStudio(I assume) you should type
dput(regions_dist6)
and add the output to your question.– NelsonGon
Nov 20 '18 at 0:41
In RStudio(I assume) you should type
dput(regions_dist6)
and add the output to your question.– NelsonGon
Nov 20 '18 at 0:41
add a comment |
1 Answer
1
active
oldest
votes
Taking joran's suggestion into account, I came up with the following:
library(tidyverse)
#load dataset
regions_dist6 <- read.csv("test.csv")
#create category-value columns for the facet_grid
reg_melt <- regions_dist6 %>%
gather(categ, categ_val, c("pop_density", "UTM44_Area_km2", "gdp_pc_inr"))
#create labels for facet_grid
xlabels <- c(pop_density = "log population density", UTM44_Area_km2 = "log road density", gdp_pc_inr = "log GDP")
eu <- ggplot(reg_melt, aes(x=log(categ_val), y=log(ET_pc_y))) +
#facet grid for the predefined categories with autoscaled x-axes
facet_grid(cols = vars(categ), scales = "free_x", labeller = as_labeller(xlabels)) +
geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2) +
scale_color_gradient(low="blue", high="red", name = "% Urbanization") +
geom_smooth(span = .95) +
ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
#remove automatic xlabel
xlab (NULL) +
labs(size = "% 4-Wheelers") +
theme_light()
x11(xpos = 50, ypos = 50)
print(eu)
Sample output with your data:
Since I only started exploring R, you better carefully check, if this is what you had in mind. And I did not find a way to label the axes of a facet_grid
individually (I just removed the common label for all three x-axes), so if someone more experienced comes up with a better solution, I am more than happy to vote for it.
Thank you Mr. T @joran for great effort. Yes I was looking for the same scheme of diagram. I will explore for labelling x-axis but current approach seems to be also acceptable.
– S. Ahmad
Nov 23 '18 at 18:26
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53382511%2fsame-y-axis-but-different-x-axis-graph%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Taking joran's suggestion into account, I came up with the following:
library(tidyverse)
#load dataset
regions_dist6 <- read.csv("test.csv")
#create category-value columns for the facet_grid
reg_melt <- regions_dist6 %>%
gather(categ, categ_val, c("pop_density", "UTM44_Area_km2", "gdp_pc_inr"))
#create labels for facet_grid
xlabels <- c(pop_density = "log population density", UTM44_Area_km2 = "log road density", gdp_pc_inr = "log GDP")
eu <- ggplot(reg_melt, aes(x=log(categ_val), y=log(ET_pc_y))) +
#facet grid for the predefined categories with autoscaled x-axes
facet_grid(cols = vars(categ), scales = "free_x", labeller = as_labeller(xlabels)) +
geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2) +
scale_color_gradient(low="blue", high="red", name = "% Urbanization") +
geom_smooth(span = .95) +
ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
#remove automatic xlabel
xlab (NULL) +
labs(size = "% 4-Wheelers") +
theme_light()
x11(xpos = 50, ypos = 50)
print(eu)
Sample output with your data:
Since I only started exploring R, you better carefully check, if this is what you had in mind. And I did not find a way to label the axes of a facet_grid
individually (I just removed the common label for all three x-axes), so if someone more experienced comes up with a better solution, I am more than happy to vote for it.
Thank you Mr. T @joran for great effort. Yes I was looking for the same scheme of diagram. I will explore for labelling x-axis but current approach seems to be also acceptable.
– S. Ahmad
Nov 23 '18 at 18:26
add a comment |
Taking joran's suggestion into account, I came up with the following:
library(tidyverse)
#load dataset
regions_dist6 <- read.csv("test.csv")
#create category-value columns for the facet_grid
reg_melt <- regions_dist6 %>%
gather(categ, categ_val, c("pop_density", "UTM44_Area_km2", "gdp_pc_inr"))
#create labels for facet_grid
xlabels <- c(pop_density = "log population density", UTM44_Area_km2 = "log road density", gdp_pc_inr = "log GDP")
eu <- ggplot(reg_melt, aes(x=log(categ_val), y=log(ET_pc_y))) +
#facet grid for the predefined categories with autoscaled x-axes
facet_grid(cols = vars(categ), scales = "free_x", labeller = as_labeller(xlabels)) +
geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2) +
scale_color_gradient(low="blue", high="red", name = "% Urbanization") +
geom_smooth(span = .95) +
ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
#remove automatic xlabel
xlab (NULL) +
labs(size = "% 4-Wheelers") +
theme_light()
x11(xpos = 50, ypos = 50)
print(eu)
Sample output with your data:
Since I only started exploring R, you better carefully check, if this is what you had in mind. And I did not find a way to label the axes of a facet_grid
individually (I just removed the common label for all three x-axes), so if someone more experienced comes up with a better solution, I am more than happy to vote for it.
Thank you Mr. T @joran for great effort. Yes I was looking for the same scheme of diagram. I will explore for labelling x-axis but current approach seems to be also acceptable.
– S. Ahmad
Nov 23 '18 at 18:26
add a comment |
Taking joran's suggestion into account, I came up with the following:
library(tidyverse)
#load dataset
regions_dist6 <- read.csv("test.csv")
#create category-value columns for the facet_grid
reg_melt <- regions_dist6 %>%
gather(categ, categ_val, c("pop_density", "UTM44_Area_km2", "gdp_pc_inr"))
#create labels for facet_grid
xlabels <- c(pop_density = "log population density", UTM44_Area_km2 = "log road density", gdp_pc_inr = "log GDP")
eu <- ggplot(reg_melt, aes(x=log(categ_val), y=log(ET_pc_y))) +
#facet grid for the predefined categories with autoscaled x-axes
facet_grid(cols = vars(categ), scales = "free_x", labeller = as_labeller(xlabels)) +
geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2) +
scale_color_gradient(low="blue", high="red", name = "% Urbanization") +
geom_smooth(span = .95) +
ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
#remove automatic xlabel
xlab (NULL) +
labs(size = "% 4-Wheelers") +
theme_light()
x11(xpos = 50, ypos = 50)
print(eu)
Sample output with your data:
Since I only started exploring R, you better carefully check, if this is what you had in mind. And I did not find a way to label the axes of a facet_grid
individually (I just removed the common label for all three x-axes), so if someone more experienced comes up with a better solution, I am more than happy to vote for it.
Taking joran's suggestion into account, I came up with the following:
library(tidyverse)
#load dataset
regions_dist6 <- read.csv("test.csv")
#create category-value columns for the facet_grid
reg_melt <- regions_dist6 %>%
gather(categ, categ_val, c("pop_density", "UTM44_Area_km2", "gdp_pc_inr"))
#create labels for facet_grid
xlabels <- c(pop_density = "log population density", UTM44_Area_km2 = "log road density", gdp_pc_inr = "log GDP")
eu <- ggplot(reg_melt, aes(x=log(categ_val), y=log(ET_pc_y))) +
#facet grid for the predefined categories with autoscaled x-axes
facet_grid(cols = vars(categ), scales = "free_x", labeller = as_labeller(xlabels)) +
geom_point(aes(colour = urb_lvl, size=car_dw_share), alpha = 0.2) +
scale_color_gradient(low="blue", high="red", name = "% Urbanization") +
geom_smooth(span = .95) +
ylab (bquote('log Commuting emissions ('*kgCO[2]/cap/year*')')) +
#remove automatic xlabel
xlab (NULL) +
labs(size = "% 4-Wheelers") +
theme_light()
x11(xpos = 50, ypos = 50)
print(eu)
Sample output with your data:
Since I only started exploring R, you better carefully check, if this is what you had in mind. And I did not find a way to label the axes of a facet_grid
individually (I just removed the common label for all three x-axes), so if someone more experienced comes up with a better solution, I am more than happy to vote for it.
answered Nov 22 '18 at 17:25
Mr. TMr. T
4,18791535
4,18791535
Thank you Mr. T @joran for great effort. Yes I was looking for the same scheme of diagram. I will explore for labelling x-axis but current approach seems to be also acceptable.
– S. Ahmad
Nov 23 '18 at 18:26
add a comment |
Thank you Mr. T @joran for great effort. Yes I was looking for the same scheme of diagram. I will explore for labelling x-axis but current approach seems to be also acceptable.
– S. Ahmad
Nov 23 '18 at 18:26
Thank you Mr. T @joran for great effort. Yes I was looking for the same scheme of diagram. I will explore for labelling x-axis but current approach seems to be also acceptable.
– S. Ahmad
Nov 23 '18 at 18:26
Thank you Mr. T @joran for great effort. Yes I was looking for the same scheme of diagram. I will explore for labelling x-axis but current approach seems to be also acceptable.
– S. Ahmad
Nov 23 '18 at 18:26
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53382511%2fsame-y-axis-but-different-x-axis-graph%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
Hi! You haven't provided enough information for anyone to help you. At a minimum, you should provide the code used to generate that graph. Better would be a complete reproducible example with data.
– joran
Nov 19 '18 at 20:59
Please provide a MCVE: stackoverflow.com/help/mcve
– Florian
Nov 19 '18 at 21:09
My advice would be to reshape your data so that the three x variables you are plotting are all in one column, with another column labelling what each value represents, and then facet on those labels. But I can' help much more than that without some data to work with.
– joran
Nov 19 '18 at 21:19
Hi, where I can add data?
– S. Ahmad
Nov 19 '18 at 21:49
1
In RStudio(I assume) you should type
dput(regions_dist6)
and add the output to your question.– NelsonGon
Nov 20 '18 at 0:41