Change Circular Histogram Bar Size and Color

Could really use the help.

  1. Would like to increase the thickness of the bars in the histogram

  2. Make the bar and graph color darker than the graph axises and border

library(ggplot2)
library(tidyverse)
library(circular)
#> 
#> Attaching package: 'circular'
#> The following objects are masked from 'package:stats':
#> 
#>     sd, var

tree_lean_example <- data_frame( "Edge" = c(228,64,259,124,150,152,309,335,256,242,233,334,34,198,229,225,105,203,260,134,231,143,165,166,156,227,317,154,102,208,191,15,144,329,184,321,230,276,155,73,289,204,201,5,246,179,301,208,202,55,223,159,112,276,85,137,226,174,158,155), 
                                 "Inside" = c(228,64,259,124,150,152,309,335,256,242,233,334,34,198,229,225,105,203,260,134,231,143,165,166,156,227,317,154,102,208,191,15,144,329,184,321,230,276,155,73,289,204,201,5,246,179,301,208,202,55,223,159,112,276,85,137,226,174,158,155))
#> Warning: `data_frame()` is deprecated, use `tibble()`.
#> This warning is displayed once per session.

theme_set(theme_classic(base_size = 35))
tree_lean_example %>%
  gather(variable, value) %>%
  ggplot(mapping = aes(x = value)) + 
  coord_polar(theta = "x", start = 0, 
              direction = 1, clip = 'off' ) +
  geom_histogram(binwidth = 25, size = 1.2) +
  scale_x_continuous(limits = c(0,359), breaks = seq(0, 360, 90)) +
  theme_bw(base_size = 35) +
  theme(text = element_text(family = "Times")) +
  labs(title = "Temporary North", x= "Degrees",y= "Frequency") +
  theme(plot.title = element_text(hjust = 0.5)) + 
  expand_limits(y = 15) +
  theme(plot.title = element_text(size=36)) +
  theme(axis.text.x = element_text(size = 16)) +
  theme(title = element_text(hjust = .5),
        plot.tag.position = c(.94, .53),
        plot.tag = element_text(size = 35)) +
  facet_grid(row = vars(variable)) 
#> Warning: Removed 4 rows containing missing values (geom_bar).

Rplot05.pdf (12.4 KB)

To make the bars "taller", remove the line expand_limits(y = 15) + from your code.

Hi dhaight,

Thank you for the response.

I made a mistake in describing the delemea, I trying to make the bars wider (thicker) than before.

Any suggestions?

Thanks,
Colin

if you want the bars wider then you need less number of bins ?
e.g:

  • geom_histogram(bins = 6)

or you might want a space in the middle ?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.