matplotlib的颜色选择可以很好地打印 [英] Color selection for matplotlib that prints well

查看:101
本文介绍了matplotlib的颜色选择可以很好地打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用pandas和matplotlib生成带有很多条形图的条形图.

I am using pandas and matplotlib to generate bar-graphs with lots of bars.

我知道如何在选定的颜色列表中循环显示(

I know how to cycle through a list of selected colors (How to give a pandas/matplotlib bar graph custom colors). The question is what colors to select so that my graph prints nicely on a paper (it is for a research paper). What I am most interested in is sufficient contrast between the columns and a selection of colors that looks pleasant. I would like to have multiple colors instead of gray-scale or single-hue colorschemes.

有没有预定的方案可供人们选择?

Are there any predetermined schemes to select from that people use?

推荐答案

在1.5版中,matplotlib将附带4种经过合理设计的新颜色图:

In 1.5 matplotlib will ship with 4 new rationally designed color maps:

  • 'viridis'(将是2.0中的默认颜色图)
  • 'magma'
  • 'plasma'
  • 'inferno'.
  • 'viridis' (will be default color map in 2.0)
  • 'magma'
  • 'plasma'
  • 'inferno'.

https://youtu.be/xAoljeRJ3lU 中介绍了设计这些颜色图的过程.

The process of designing these color maps is presented in https://youtu.be/xAoljeRJ3lU .

为此过程开发的工具可以由pip install viscm

The tool developed for this process can be installed by pip install viscm

我建议使用cubehelix颜色图.它是设计的,具有正确的颜色和灰色亮度排序,规模

I would suggest the cubehelix color map. It is designed to have correct luminosity ordering in both color and gray-scale

这篇关于matplotlib的颜色选择可以很好地打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆