I have the following data:
- 10 states
- Each state has two types
- Each type has from 1 to 29 objects
- Each type of state object has a counter
Full data is available as an entity .
I am trying to imagine what proportion of the calculations were made for each object. For this, I used the following code:
icc <- transform( icc, state=factor(state), entity=factor(entity), type=factor(type) ) p <- ggplot( icc, aes( x=state, y=count, fill=entity ) ) + geom_bar( stat="identity", position="stack" ) + facet_grid( type ~ . ) custom_theme <- theme_update(legend.position="none") p

Unfortunately, I am losing a lot of information because state types with a large number of objects do not display enough unique colors.
As mentioned above, I have 125 objects, but most of the objects in type state are 29. Is there a way to get ggplot2 and colorbrewer to assign a unique (and hopefully fairly clear) color to each entity type?
The only way I came across is to force the entity to an integer that works, but does not provide significant color differentiation between levels.
source share