The Matplotlib’s plot() function supports 3 different types of parameter values: 1. Using different colors in a Matplotlib bar plot is a powerful technique for adding emphasis to a visualization. One is a predefined set of values. I'm wondering if there are there any convenience functions that people use to map colors to values using pandas dataframes and Matplotlib? Setting the style is as easy as calling matplotlib.style.use(my_plot_style) before creating your plot. Matplotlib is an amazing visualization library in Python for 2D plots of arrays. With this scatter plot we can visualize the different dimension of the data: the x,y location corresponds to Population and Area, the size of point is related to the total population and color is related to particular continent Depending on the value of active, I'd like to color the line plot. There is a ylim method in pyplot bar function that will limit or change the y-axis values. Alongside cmap, we will also need a variable c which is can take a few different forms: A single string representing a color For this new species variable, we will use a matplotlib function called cmap to create a "color map". I want to plot x vs. t and color the ticks based on the value of y. e.g. Different Color Parameter Values Accepted By The Plot Function. You can find all the defined color names in matplotlib's color.py file. Colormap instances are used to convert data values (floats) from the interval [0, 1] to the RGBA color that the respective Colormap represents. In this example, in-order to create random values ranging between 0 and 1. The graph #180 explains how to make a lollipop plot with Matplotlib, whatever the shape of your data.This page aims to describe the customization you can apply to the 3 main parts: the stem, the markers and the baseline.Note that for all of these 3 components, we first build the stem plot with the stem() function, and then customize it with the plt.setp function. From version 1.5 and up, matplotlib offers a range of pre-configured plotting styles. import matplotlib.pyplot as plt x = ['A', 'B', 'C'] y = [1, 5, 3] plt.barh(x, y) plt.show() This results in a horizontally-oriented Bar Plot: Change Bar Plot Color in Matplotlib. Matplotlib Colormap. Setting the style can be used to easily give plots the general look that you want. I have 2 variables (x,y) that change with time (t). Limit Y-axis values of Python bar plot. So this begs us the next question. Here, we changed the starting value from 0 to 50000 and end value from 2500000 to 3000000. Matplotlib supports RGB or RGBA with float values in the range 0-1. Predefined color set. What type of values can we pass to specify a color to the plot() function? ... cyan','magenta'] data.plot(color=colors) You can use color names or Color hex codes like '#000000' for black say. A color map is a set of RGBA colors built into matplotlib that can be "mapped" to specific values in a data set. For example, colors can show additional categories beyond the ones represented by the bars themselves, they can draw attention to a particuallarly important data point, or they can simply add more visual distinction. Now RGB or RGBA values that range between 0-1 determine the color for the chart. Changing the color of the bars themselves is as easy as setting the color argument with a list of colors. This thread seems to be the "right" solution, but I'm having an issue: seaborn or matplotlib line chart, line color depending on variable The OP and I are trying to achieve the same thing: Here's a broken plot/reproducer: Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. for highest values of y the tick color is dark green, for lowest value is dark red, and for intermediate values the color will be scaled in between green and red.