title: Removing the margin and change the font style for labels in ggplot
body: <p>I have generated a dendrogram using ggdendro and ggplot. I have two issues regarding the generated plot. </p>
  
  <ol>
  <li>Is that possible to cut some margin from the generated plot?</li>
  <li>How to change the font style, e.g., size, for the label along one axis?</li>
  </ol>
  
  <p>In the plot, the two areas marked by "red pane" are the margins I would like to remove. The six labels along the x-axis is marked with yellow color. I would like to increase the size of them. </p>
  
  <p><img src="https://i.stack.imgur.com/H14u4.png" alt="enter image description here"></p>
  
  <p>The code:</p>
  
  <pre><code>&gt; x&lt;-read.csv("test1.csv",header=TRUE)
  &gt; d&lt;-as.dist(x,diag=FALSE,upper=FALSE)
  &gt; hc&lt;-hclust(d,"ave")
  &gt; dhc&lt;-as.dendrogram(hc)
  &gt; ddata&lt;-dendro_data(dhc,type="rectangle")
  &gt; ddata$labels$text &lt;- gsub("\\."," ",ddata$labels$text)
  &gt; fig1&lt;-ggplot(segment(ddata))+geom_segment(aes(x=x0,y=y0,xend=x1,yend=y1))
  &gt; fig1&lt;-fig1+xlab(NULL)+ylab(NULL)+opts(panel.grid.minor=theme_blank())
  &gt; fig1&lt;-fig1+scale_x_discrete(limits=ddata$labels$text)
  &gt; fig1&lt;-fig1+coord_flip()
  &gt; last_plot()
  &gt; fig1&lt;-last_plot()
  &gt; ggsave("test1.pdf")
  </code></pre>