This is happening because you likely have a huge amount of legend options (most probably with long names) and this is overshadowing the plot itself. You should try filtering the number of samples that you look at when you go to lower taxonomic levels or only look at a subset of taxa. For example, instead of looking at all genera in your dataset, try to look only at the genera that are present in your most abundant phyla.
Even if you could fix the legend issue, your abundance plots would likely be impossible to interpret because of the large number of individual taxonomic assignments and the limitations on discrete color distinction.
You should take a look at filter_taxa
, subset_taxa
, and subset_samples
(and other similar functions in the phyloseq
package) functions
In addition, it looks like your code was not formatted correctly to make it easy to read for people trying to help you. Formatting code allows for people to more easily identify where issues may be occurring, and makes it easier to read, in general. I have edited you post to format the code properly.
In the future please put code that is inline (such as a function name, like mutate
or filter
) inside of backticks (`mutate`
) and chunks of code (including error messages and code copied from the console) can be put between sets of three backticks:
```
example <- foo %>%
filter(a == 1)
```
This process can be done automatically by highlighting your code, either inline or in a chunk, and clicking the </>
button on the toolbar of the reply window!
This will help keep our community tidy and help you get the help you are looking for!
For more information, please take a look at the community's FAQ on formating code