Learn R Programming

ggpattern (version 1.0.1)

scale_pattern_manual: Create your own discrete scale

Description

Create your own discrete scale

Usage

scale_pattern_manual(..., values, breaks = waiver())

scale_pattern_type_manual(..., values, breaks = waiver())

scale_pattern_subtype_manual(..., values, breaks = waiver())

scale_pattern_angle_manual(..., values, breaks = waiver())

scale_pattern_density_manual(..., values, breaks = waiver())

scale_pattern_spacing_manual(..., values, breaks = waiver())

scale_pattern_xoffset_manual(..., values, breaks = waiver())

scale_pattern_yoffset_manual(..., values, breaks = waiver())

scale_pattern_alpha_manual(..., values, breaks = waiver())

scale_pattern_linetype_manual(..., values, breaks = waiver())

scale_pattern_size_manual(..., values, breaks = waiver())

scale_pattern_shape_manual(..., values, breaks = waiver())

scale_pattern_colour_manual(..., values, breaks = waiver())

scale_pattern_fill_manual(..., values, breaks = waiver())

scale_pattern_fill2_manual(..., values, breaks = waiver())

scale_pattern_aspect_ratio_manual(..., values, breaks = waiver())

scale_pattern_key_scale_factor_manual(..., values, breaks = waiver())

scale_pattern_filename_manual(..., values, breaks = waiver())

scale_pattern_filter_manual(..., values, breaks = waiver())

scale_pattern_gravity_manual(..., values, breaks = waiver())

scale_pattern_scale_manual(..., values, breaks = waiver())

scale_pattern_orientation_manual(..., values, breaks = waiver())

scale_pattern_phase_manual(..., values, breaks = waiver())

scale_pattern_frequency_manual(..., values, breaks = waiver())

scale_pattern_grid_manual(..., values, breaks = waiver())

scale_pattern_res_manual(..., values, breaks = waiver())

scale_pattern_rot_manual(..., values, breaks = waiver())

Value

A ggplot2::Scale object.

Arguments

..., values, breaks

See ggplot2 for documentation on manual scales. e.g. ggplot2::scale_colour_manual()

Examples

Run this code
  if (require('ggplot2')) {
    gg <- ggplot(mtcars) +
       geom_density_pattern(
         aes(
           x            = mpg,
           pattern_fill = as.factor(cyl),
           pattern_type = as.factor(cyl)
         ),
         pattern = 'polygon_tiling',
         pattern_key_scale_factor = 1.2
       ) +
       scale_pattern_type_manual(values = c('hexagonal', 'rhombille',
                                  'pythagorean')) +
       theme_bw(18) +
       theme(legend.key.size = unit(2, 'cm')) +
       labs(
         title    = 'ggpattern::geom_density_pattern()',
         subtitle = 'pattern = \'polygon_tiling\''
       )
    plot(gg)
  }

Run the code above in your browser using DataLab