How to use Rcolorbrewer palette for plotting graphs using base plot package in R

This recipe helps you use Rcolorbrewer palette for plotting graphs using base plot package in R

Recipe Objective

How to use Rcolorbrewer palette for plotting graphs using the base plot package in R?

The r color palette is used for changing the default color of graphs plotted using different libraries. —The base plot package uses 5 different syntaxes— rainbow (n), heat.colors (n), terrain.colors (n), topo.colors (n), and cm.colors (n). This recipe demonstrates an example of how to use Rcolorbrewer palette using the base plot package. ![image.png](attachment:image.png)

Learn to Implement Deep Learning Techniques for Medical Image Segmentation

Step 1- Define a vector

values = c(5,10,15,20,25,30)

Step 2 - Plot a bar chart

barplot(values) # default color for the bar plot

Step 3 - Use all the available functions

barplot(values, col =rainbow(6)) barplot(values, col = heat.colors(6)) barplot(values, col =terrain.colors(6)) barplot(values, col =topo.colors(6)) barplot(values, col =cm.colors(6)) {"mode":"full","isActive":false}

What Users are saying..

profile image

Ed Godalle

Director Data Analytics at EY / EY Tech
linkedin profile url

I am the Director of Data Analytics with over 10+ years of IT experience. I have a background in SQL, Python, and Big Data working with Accenture, IBM, and Infosys. I am looking to enhance my skills... Read More

Relevant Projects

AWS MLOps Project to Deploy Multiple Linear Regression Model
Build and Deploy a Multiple Linear Regression Model in Python on AWS

AWS MLOps Project to Deploy a Classification Model [Banking]
In this AWS MLOps project, you will learn how to deploy a classification model using Flask on AWS.

ML Model Deployment on AWS for Customer Churn Prediction
MLOps Project-Deploy Machine Learning Model to Production Python on AWS for Customer Churn Prediction

Time Series Project to Build a Multiple Linear Regression Model
Learn to build a Multiple linear regression model in Python on Time Series Data

MLOps Project on GCP using Kubeflow for Model Deployment
MLOps using Kubeflow on GCP - Build and deploy a deep learning model on Google Cloud Platform using Kubeflow pipelines in Python

Ensemble Machine Learning Project - All State Insurance Claims Severity Prediction
In this ensemble machine learning project, we will predict what kind of claims an insurance company will get. This is implemented in python using ensemble machine learning algorithms.

LLM Project to Build and Fine Tune a Large Language Model
In this LLM project for beginners, you will learn to build a knowledge-grounded chatbot using LLM's and learn how to fine tune it.

Azure Text Analytics for Medical Search Engine Deployment
Microsoft Azure Project - Use Azure text analytics cognitive service to deploy a machine learning model into Azure Databricks

MLOps Project to Deploy Resume Parser Model on Paperspace
In this MLOps project, you will learn how to deploy a Resume Parser Streamlit Application on Paperspace Private Cloud.

Medical Image Segmentation Deep Learning Project
In this deep learning project, you will learn to implement Unet++ models for medical image segmentation to detect and classify colorectal polyps.