Barchart: Legendary Italics


Tanya

I'm trying to keep the first label in the legend while converting the rest to italics, but I don't know how to do that. The code I use is:

ggplot(the_data_mod) +
  geom_bar(aes(x = Protein, y = Protein_Abundance, fill = Mutant), 
           stat = "identity", position = position_dodge(), col = "white") + 
  theme_minimal()+   
  labs(title = "Relative Levels of TOC Protein Abundance across SP2 Mutants", 
       x = "Protein")+
  ylab(expression(atop("Protein Abundance", paste("(Normalised Relative to WT)"))))

The data is:

structure(list(Mutant = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L), .Label = c("WT", "ppi1", "sp2-4", "sp2-1 ppi1", "sp2-3 ppi1", "sp2-5 ppi1", "sp2-6 ppi1", "sp2-8 ppi1"), class = "factor"), Protein = c("TOC75", "TOC75", "TOC75", "TOC75", "TOC75", "TOC75", "TOC75", "TOC75", "TOC159", "TOC159", "TOC159", "TOC159", "TOC159", "TOC159", "TOC159", "TOC159" ), Protein_Abundance = c(100, 19.79, 209.85, 364.6, 183.14, 435.02, 22.23, 109.79, 100, 39.52, 266.72, 88.66, 105.04, 132.01, 99.7, 140.1349751)), class = "data.frame", row.names = c(NA, -16L))

Barbana

You can use the following code

  ggplot(the_data_mod, aes(x = Protein, y = Protein_Abundance, fill = Mutant)) + 
  geom_bar(stat = "identity", position = position_dodge(), col = "white") +
  scale_fill_discrete("Mutant",
                      labels = c(expression(italic("ppi1")), 
                                 expression(italic("sp2-1 ppi1")),
                                 expression(italic("sp2-3 ppi1")),
                                 expression(italic("sp2-4")),
                                 expression(italic("sp2-5 ppi1")), 
                                 expression(italic("sp2-6 ppi1")),
                                 expression(italic("sp2-8 ppi1")),
                                 expression(italic("WT")))) + 
  theme_minimal()+  
  theme(legend.text.align = 0)+  
  labs(title = "Relative Levels of TOC Protein Abundance across SP2 Mutants", 
       x = "Protein")+
  ylab(expression(atop("Protein Abundance", paste("(Normalised Relative to WT)"))))

enter image description here

Related


Barchart: Legendary Italics

Tanya I'm trying to keep the first label in the legend while converting the rest to italics, but I don't know how to do that. The code I use is: ggplot(the_data_mod) + geom_bar(aes(x = Protein, y = Protein_Abundance, fill = Mutant), stat = "ident

Barchart: Legendary Italics

Tanya I'm trying to keep the first label in the legend while converting the rest to italics, but I don't know how to do that. The code I use is: ggplot(the_data_mod) + geom_bar(aes(x = Protein, y = Protein_Abundance, fill = Mutant), stat = "ident

Barchart: Legendary Italics

Tanya I'm trying to keep the first label in the legend while converting the rest to italics, but I don't know how to do that. The code I use is: ggplot(the_data_mod) + geom_bar(aes(x = Protein, y = Protein_Abundance, fill = Mutant), stat = "ident

Legendary Pagination

mahip_j Actually I work on D3js charts. I implemented pagination in the legend, but I ended up with two legends repeating. How can I fix this? I provide a fiddle of the current code here. jsfiddle link Thanks in advance for any help var data=[

Legendary Pagination

mahip_j Actually I work on D3js charts. I implemented pagination in the legend, but I ended up with two legends repeating. How can I fix this? I provide a fiddle of the current code here. jsfiddle link Thanks in advance for any help var data=[

Legendary Pagination

mahip_j Actually I work on D3js charts. I implemented pagination in the legend, but I have two duplicate legends at the end. How can I fix this? I provide a fiddle of the current code here. jsfiddle link Thanks in advance for any help var data=

Legendary Pagination

mahip_j Actually I work on D3js charts. I implemented pagination in the legend, but I have two duplicate legends at the end. How can I fix this? I provide a fiddle of the current code here. jsfiddle link Thanks in advance for any help var data=

italics in emacs

Eastafri I'm a bit new to emacs. I am editing a document in latex and I want to write some words in italics. I want a simple macro where if you put the cursor on a word and press a key combination, the word is surrounded by italics like this \textit{word}. Is

Is italics in bold?

Heykatieben Nowadays, font-style:italic in css only displays my font in bold on Chrome and Firefox (not on Safari). For example, use the following css: em { font-style: italic; } and this HTML: <p><em>Hi, I'm showing up in bold.</em></p> In italics and bold

italics in emacs

Eastafri I'm a bit new to emacs. I am editing a document in latex and I want to write some words in italics. I want a simple macro where if you put the cursor on a word and press a key combination, the word is surrounded by italics like this \textit{word}. Is

Is italics in bold?

Heykatieben Nowadays, font-style:italic in css only displays my font in bold on Chrome and Firefox (not on Safari). For example, use the following css: em { font-style: italic; } and this HTML: <p><em>Hi, I'm showing up in bold.</em></p> In italics and bold

Font styles: italics and italics in CSS

Rajak What is the difference between the two: font-style:italic font-style:oblique I tried using the W3Schools editor but couldn't tell the difference. What am I missing? Jabbons In its purest (type designer) perspective, a bevel is a roman typeface that has

Font styles: italics and italics in CSS

Rajak What is the difference between the two: font-style:italic font-style:oblique I tried using the W3Schools editor but couldn't tell the difference. What am I missing? Jabbons In its purest (type designer) perspective, a bevel is a roman typeface that has

Font styles: italics and italics in CSS

Rajak What is the difference between the two: font-style:italic font-style:oblique I tried using the W3Schools editor but couldn't tell the difference. What am I missing? Jabbons In its purest (type designer) perspective, a bevel is a roman typeface that has

legendary greek letters in R

Patrick Lee I want to plot three curves on the same graph with different parameter alpha. curve(sin(x), from = 1, to = 3, lty = 1, ylim = c(-1, 1)) curve(sin(2 * x), add = TRUE, lty = 2) curve(sin(3 * x), add = TRUE, lty = 3) legend("topright", legend = ex

"None" in legendary pandas python

Michal Spirewski I am using WinPython Notebook with Python 2.7. So I'm reading several DataFrames like this: run[y2][y3][x] = pd.read_excel(xls_file, x) When to use: run[y2][y3][x].plot() I get nice plots with 3 rows and legends described in the excel file a

Hear the legendary hover

Aknapp I'm trying to change the fill opacity of points in a scatterplot when the user hovers over the legend. I am trying to mimic the following code block: http://blockbuilder.org/curran/0d2cc6698cad72a48027b8de0ebb417d My code is available at : http://bl.ock

Reuse Legendary Logic

Thomas K We have a generic Form component with a legend attached to handle validation and submission function* validateAndSubmit(action) { const errors = clientSideValidate(action.values); if (errors) { return yield put({type: SUBMIT_FAILED, fo

"None" in legendary pandas python

Michał Spirzewski I am using WinPython Notebook with Python 2.7. So I'm reading several DataFrames like this: run[y2][y3][x] = pd.read_excel(xls_file, x) When to use: run[y2][y3][x].plot() I get nice plots with 3 rows and legends described in the excel file

legendary greek letters in R

Li Jie I want to plot three curves on the same graph with different parameter alpha. curve(sin(x), from = 1, to = 3, lty = 1, ylim = c(-1, 1)) curve(sin(2 * x), add = TRUE, lty = 2) curve(sin(3 * x), add = TRUE, lty = 3) legend("topright", legend = express

legendary greek letters in R

Patrick Lee I want to plot three curves on the same graph with different parameter alpha. curve(sin(x), from = 1, to = 3, lty = 1, ylim = c(-1, 1)) curve(sin(2 * x), add = TRUE, lty = 2) curve(sin(3 * x), add = TRUE, lty = 3) legend("topright", legend = ex

"None" in legendary pandas python

Michal Spirewski I am using WinPython Notebook with Python 2.7. So I'm reading several DataFrames like this: run[y2][y3][x] = pd.read_excel(xls_file, x) When to use: run[y2][y3][x].plot() I get nice plots with 3 rows and legends described in the excel file a

Hear the legendary hover

Aknapp I'm trying to change the fill opacity of points in a scatterplot when the user hovers over the legend. I am trying to mimic the following code block: http://blockbuilder.org/curran/0d2cc6698cad72a48027b8de0ebb417d My code is available from : http://bl.o

Get Seaborn Legendary Locations

Matt I would like to add a comment under my legend. Here is a sample code that does what I want: import pandas as pd import numpy as np import matplotlib.pyplot as plt np.random.seed(0) df1 = pd.DataFrame(np.random.normal(size=100)) df2 = pd.DataFrame(np.rand

Reuse Legendary Logic

Thomas K We have a generic Form component with a legend attached to handle validation and submission function* validateAndSubmit(action) { const errors = clientSideValidate(action.values); if (errors) { return yield put({type: SUBMIT_FAILED, fo

"None" in legendary pandas python

Michał Spirzewski I am using WinPython Notebook with Python 2.7. So I'm reading several DataFrames like this: run[y2][y3][x] = pd.read_excel(xls_file, x) When to use: run[y2][y3][x].plot() I get nice plots with 3 rows and legends described in the excel file

legendary greek letters in R

Li Jie I want to plot three curves on the same graph with different parameter alpha. curve(sin(x), from = 1, to = 3, lty = 1, ylim = c(-1, 1)) curve(sin(2 * x), add = TRUE, lty = 2) curve(sin(3 * x), add = TRUE, lty = 3) legend("topright", legend = express

Masstransit, no legendary resource created

Boris I have two services, one acts as a consumer and the other acts as a producer. Below is my configuration for each of them. Producer configuration services .AddSingleton(KebabCaseEndpointNameFormatter.Instance); services .AddMassTransit(config =>

legendary greek letters in R

Patrick Lee I want to plot three curves on the same graph with different parameter alpha. curve(sin(x), from = 1, to = 3, lty = 1, ylim = c(-1, 1)) curve(sin(2 * x), add = TRUE, lty = 2) curve(sin(3 * x), add = TRUE, lty = 3) legend("topright", legend = ex