[Matplotlib-users] reduce the number of ticks

2014-02-17 Thread Pierre Haessig
Hi,

In order to get a plot with a small number of ticks, it is possible to
create a matplotlib.ticker.MaxNLocator object with a small value for
`nbins`.

However, I found it also possible to modify the existing AutoLocator
instances, since AutoLocator derives from MaxNLocator :

ax.xaxis.major.locator.set_params(nbins=5)
ax.yaxis.major.locator.set_params(nbins=5)

(the default nbins value seems to be 9)

The advantage of this inplace solution is that it doesn't any
importing/browsing in the mpl namespace. However, it's still a bit long.

I was then wondering :
1) is this solution recommended or not ?
2) is there a shortcup to avoird the five dots ?

best,
Pierre
attachment: pierre_haessig.vcf

signature.asc
Description: OpenPGP digital signature
--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] reduce the number of ticks

2014-02-17 Thread Eric Firing
On 2014/02/17 4:58 AM, Pierre Haessig wrote:
 Hi,

 In order to get a plot with a small number of ticks, it is possible to
 create a matplotlib.ticker.MaxNLocator object with a small value for
 `nbins`.

 However, I found it also possible to modify the existing AutoLocator
 instances, since AutoLocator derives from MaxNLocator :

 ax.xaxis.major.locator.set_params(nbins=5)
 ax.yaxis.major.locator.set_params(nbins=5)

 (the default nbins value seems to be 9)

 The advantage of this inplace solution is that it doesn't any
 importing/browsing in the mpl namespace. However, it's still a bit long.

 I was then wondering :
 1) is this solution recommended or not ?
 2) is there a shortcup to avoird the five dots ?

http://matplotlib.org/api/pyplot_api.html?highlight=locator_params#matplotlib.pyplot.locator_params

This is both a pyplot function and an Axes method.

Eric


 best,
 Pierre


--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] reduce the number of ticks

2014-02-17 Thread Pierre Haessig
Le 17/02/2014 18:13, Eric Firing a écrit :
  I was then wondering :
  1) is this solution recommended or not ?
  2) is there a shortcup to avoird the five dots ?
 http://matplotlib.org/api/pyplot_api.html?highlight=locator_params#matplotlib.pyplot.locator_params

 This is both a pyplot function and an Axes method.
Thanks a lot!

I guess it would be nice to add a back reference to this method in
http://matplotlib.org/api/ticker_api.html

best,
Pierre
attachment: pierre_haessig.vcf

signature.asc
Description: OpenPGP digital signature
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] colorbllind problem

2014-02-17 Thread ChaoYue
Hi Gabriele,

I'm afraid you have to put the numbers by yourself using the plt.text, as
in an example:
a = np.arange(10)
b = np.tile(a,(10,1))
c = np.tile(a[:,np.newaxis],(10)) + b
plot(c)
for i in range(10):
plt.text(5,c[i][5],str(i))


I've askd by a review to use the colorblind compatible colors when trying
to submit a paper,
and I find a website below:
http://jfly.iam.u-tokyo.ac.jp/color/

I put some RGB numbers for some colors here if you feel like to have a try:
CCC =
{

'Black':np.array([0,0,0])/255.,

'Orange':np.array([230,159,0])/255.,

'Skyblue':np.array([85,180,233])/255.,

'BluishGreen':np.array([0,158,115])/255.,

'Yellow':np.array([240,228,66])/255.,

'Blue':np.array([0,114,178])/255.,

'Vermilion':np.array([213,94,0])/255.,

'ReddishPurple':np.array([204,121,167])/255.
   }

Cheers,

Chao



On Mon, Feb 17, 2014 at 7:17 PM, Gabriele Brambilla [via matplotlib] 
ml-node+s1069221n42884...@n5.nabble.com wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion on how could I show a plot like the one
 attached to him?
 Is there an option in pyplot that write little numbers near the curves
 instead of colors?

 thanks

 Gabriele

 --

 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=42884i=0
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 *daltonic.png* (181K) Download 
 Attachmenthttp://matplotlib.1069221.n5.nabble.com/attachment/42884/0/daltonic.png


 --
  If you reply to this email, your message will be added to the discussion
 below:
 http://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884.html
  To start a new topic under matplotlib - users, email
 ml-node+s1069221n...@n5.nabble.com
 To unsubscribe from matplotlib, click 
 herehttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx
 .
 NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




-- 
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16





--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884p42886.html
Sent from the matplotlib - users mailing list archive at Nabble.com.--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] colorbllind problem

2014-02-17 Thread Adam Hughes
I'm wondering if the matplotlib API is designed in such a way that choosing
a color schema could be done at import time.  I know that the entire plot
style can be changed in one call (eg put plt.xkcd() at the beginning of
your code), so I wander if colorblind-compatible colors could be loaded in
a similar, quick way.


On Mon, Feb 17, 2014 at 1:52 PM, ChaoYue chaoyue...@gmail.com wrote:

 Hi Gabriele,

 I'm afraid you have to put the numbers by yourself using the plt.text, as
 in an example:
 a = np.arange(10)
 b = np.tile(a,(10,1))
 c = np.tile(a[:,np.newaxis],(10)) + b
 plot(c)
 for i in range(10):
 plt.text(5,c[i][5],str(i))


 I've askd by a review to use the colorblind compatible colors when trying
 to submit a paper,
 and I find a website below:
 http://jfly.iam.u-tokyo.ac.jp/color/

 I put some RGB numbers for some colors here if you feel like to have a try:
 CCC =
 {

 'Black':np.array([0,0,0])/255.,

 'Orange':np.array([230,159,0])/255.,

 'Skyblue':np.array([85,180,233])/255.,

 'BluishGreen':np.array([0,158,115])/255.,

 'Yellow':np.array([240,228,66])/255.,

 'Blue':np.array([0,114,178])/255.,

 'Vermilion':np.array([213,94,0])/255.,

 'ReddishPurple':np.array([204,121,167])/255.
}

 Cheers,

 Chao



 On Mon, Feb 17, 2014 at 7:17 PM, Gabriele Brambilla [via matplotlib] [hidden
 email] http://user/SendEmail.jtp?type=nodenode=42886i=0 wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion on how could I show a plot like the one
 attached to him?
 Is there an option in pyplot that write little numbers near the curves
 instead of colors?

 thanks

 Gabriele

 --

 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=42884i=0
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 *daltonic.png* (181K) Download 
 Attachmenthttp://matplotlib.1069221.n5.nabble.com/attachment/42884/0/daltonic.png


 --
  If you reply to this email, your message will be added to the
 discussion below:
 http://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884.html
  To start a new topic under matplotlib - users, email [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=42886i=1
 To unsubscribe from matplotlib, click here.
 NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




 --

 ***
 Chao YUE
 Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
 UMR 1572 CEA-CNRS-UVSQ
 Batiment 712 - Pe 119
 91191 GIF Sur YVETTE Cedex
 Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16

 

 --
 View this message in context: Re: colorbllind 
 problemhttp://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884p42886.html
 Sent from the matplotlib - users mailing list 
 archivehttp://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.htmlat 
 Nabble.com.


 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] colorbllind problem

2014-02-17 Thread Paul Hobson
Adam,

Look into the seaborn project:
http://nbviewer.ipython.org/github/mwaskom/seaborn/blob/master/examples/aesthetics.ipynb

it's easy enough to define your own color palettes or select existing ones.
-paul


On Mon, Feb 17, 2014 at 11:41 AM, Adam Hughes hughesada...@gmail.comwrote:

 I'm wondering if the matplotlib API is designed in such a way that
 choosing a color schema could be done at import time.  I know that the
 entire plot style can be changed in one call (eg put plt.xkcd() at the
 beginning of your code), so I wander if colorblind-compatible colors could
 be loaded in a similar, quick way.


 On Mon, Feb 17, 2014 at 1:52 PM, ChaoYue chaoyue...@gmail.com wrote:

 Hi Gabriele,

 I'm afraid you have to put the numbers by yourself using the plt.text, as
 in an example:
 a = np.arange(10)
 b = np.tile(a,(10,1))
 c = np.tile(a[:,np.newaxis],(10)) + b
 plot(c)
 for i in range(10):
 plt.text(5,c[i][5],str(i))


 I've askd by a review to use the colorblind compatible colors when trying
 to submit a paper,
 and I find a website below:
 http://jfly.iam.u-tokyo.ac.jp/color/

 I put some RGB numbers for some colors here if you feel like to have a
 try:
 CCC =
 {

 'Black':np.array([0,0,0])/255.,

 'Orange':np.array([230,159,0])/255.,

 'Skyblue':np.array([85,180,233])/255.,

 'BluishGreen':np.array([0,158,115])/255.,

 'Yellow':np.array([240,228,66])/255.,

 'Blue':np.array([0,114,178])/255.,

 'Vermilion':np.array([213,94,0])/255.,

 'ReddishPurple':np.array([204,121,167])/255.
}

 Cheers,

 Chao



 On Mon, Feb 17, 2014 at 7:17 PM, Gabriele Brambilla [via matplotlib] [hidden
 email] http://user/SendEmail.jtp?type=nodenode=42886i=0 wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion on how could I show a plot like the one
 attached to him?
 Is there an option in pyplot that write little numbers near the curves
 instead of colors?

 thanks

 Gabriele

 --

 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=42884i=0
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 *daltonic.png* (181K) Download 
 Attachmenthttp://matplotlib.1069221.n5.nabble.com/attachment/42884/0/daltonic.png


 --
  If you reply to this email, your message will be added to the
 discussion below:
 http://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884.html
  To start a new topic under matplotlib - users, email [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=42886i=1
 To unsubscribe from matplotlib, click here.
 NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




 --

 ***
 Chao YUE
 Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
 UMR 1572 CEA-CNRS-UVSQ
 Batiment 712 - Pe 119
 91191 GIF Sur YVETTE Cedex
 Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16

 

 --
 View this message in context: Re: colorbllind 
 problemhttp://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884p42886.html
 Sent from the matplotlib - users mailing list 
 archivehttp://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.htmlat 
 Nabble.com.


 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



Re: [Matplotlib-users] colorbllind problem

2014-02-17 Thread Scott Lasley

On Feb 17, 2014, at 1:15 PM, Gabriele Brambilla 
gb.gabrielebrambi...@gmail.com wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion on how could I show a plot like the one attached 
 to him?
 Is there an option in pyplot that write little numbers near the curves 
 instead of colors?
 
 thanks
 
 Gabriele

Have you thought about plotting black lines and using different line styles?  
You could use very different line styles for lines that are close together such 
as 108.6 and 144.8 where trying to label the lines with a small number may be 
difficult.  You might also use different markers for each line.  You could only 
plot one or two markers if you don't want them cluttering up the lines.

hth,
Scott
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] colorbllind problem

2014-02-17 Thread C M
On Mon, Feb 17, 2014 at 1:15 PM, Gabriele Brambilla 
gb.gabrielebrambi...@gmail.com wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion on how could I show a plot like the one
 attached to him?
 Is there an option in pyplot that write little numbers near the curves
 instead of colors?


In addition to the other suggestions:  If this is a plot that is viewed on
his computer, you could also build in line picking, so that if the user
mouses over the line, information about that line is shown in the toolbar
or however you want.
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] colorbllind problem

2014-02-17 Thread Gabriele Brambilla
Hi, I would like to set the color of the different plots with seaborn but I
don't find examples of this kind on the tutorial.
How could I modify this code? the zip() arguments are lists of the same
dimension.

zipPARA = zip(As, GAMMAs, EcutS, Bees, angles)

lotgr = plt.figure()

axius = lotgr.add_subplot(111)

for a1,b1,c1,d1,angol in zipPARA:

fittedval = spock(logeels, a1, b1, c1, d1)

angli = str(angol)

imig = axius.plot(logeels, fittedval, label=angli)

axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.)

lotgr.canvas.draw()

thanks

Gabriele


2014-02-17 14:46 GMT-05:00 Paul Hobson pmhob...@gmail.com:

 Adam,

 Look into the seaborn project:

 http://nbviewer.ipython.org/github/mwaskom/seaborn/blob/master/examples/aesthetics.ipynb

 it's easy enough to define your own color palettes or select existing ones.
 -paul


 On Mon, Feb 17, 2014 at 11:41 AM, Adam Hughes hughesada...@gmail.comwrote:

 I'm wondering if the matplotlib API is designed in such a way that
 choosing a color schema could be done at import time.  I know that the
 entire plot style can be changed in one call (eg put plt.xkcd() at the
 beginning of your code), so I wander if colorblind-compatible colors could
 be loaded in a similar, quick way.


 On Mon, Feb 17, 2014 at 1:52 PM, ChaoYue chaoyue...@gmail.com wrote:

 Hi Gabriele,

 I'm afraid you have to put the numbers by yourself using the plt.text,
 as in an example:
 a = np.arange(10)
 b = np.tile(a,(10,1))
 c = np.tile(a[:,np.newaxis],(10)) + b
 plot(c)
 for i in range(10):
 plt.text(5,c[i][5],str(i))


 I've askd by a review to use the colorblind compatible colors when
 trying to submit a paper,
 and I find a website below:
 http://jfly.iam.u-tokyo.ac.jp/color/

 I put some RGB numbers for some colors here if you feel like to have a
 try:
 CCC =
 {

 'Black':np.array([0,0,0])/255.,

 'Orange':np.array([230,159,0])/255.,

 'Skyblue':np.array([85,180,233])/255.,

 'BluishGreen':np.array([0,158,115])/255.,

 'Yellow':np.array([240,228,66])/255.,

 'Blue':np.array([0,114,178])/255.,

 'Vermilion':np.array([213,94,0])/255.,

 'ReddishPurple':np.array([204,121,167])/255.
}

 Cheers,

 Chao



 On Mon, Feb 17, 2014 at 7:17 PM, Gabriele Brambilla [via matplotlib] 
 [hidden
 email] http://user/SendEmail.jtp?type=nodenode=42886i=0 wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion on how could I show a plot like the one
 attached to him?
 Is there an option in pyplot that write little numbers near the curves
 instead of colors?

 thanks

 Gabriele

 --

 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=42884i=0
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 *daltonic.png* (181K) Download 
 Attachmenthttp://matplotlib.1069221.n5.nabble.com/attachment/42884/0/daltonic.png


 --
  If you reply to this email, your message will be added to the
 discussion below:
 http://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884.html
  To start a new topic under matplotlib - users, email [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=42886i=1
 To unsubscribe from matplotlib, click here.
 NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




 --

 ***
 Chao YUE
 Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
 UMR 1572 CEA-CNRS-UVSQ
 Batiment 712 - Pe 119
 91191 GIF Sur YVETTE Cedex
 Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16

 

 --
 View this message in context: Re: colorbllind 
 problemhttp://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884p42886.html
 Sent from the matplotlib - users mailing list 
 archivehttp://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.htmlat 
 Nabble.com.


 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 

Re: [Matplotlib-users] colorbllind problem

2014-02-17 Thread Paul Hobson
Untested, of course, but I would do something like this:

import matplotlib.pyplot as plt
import seaborn

N = len(As)

myPallette = seaborn.color_palette(skyblue, N)  # use the name of  any
mpl colormap here
seaborn.set_color_pallette(myPallette)

zipPARA = zip(As, GAMMAs, EcutS, Bees, angles)
lotgr = plt.figure()
axius = lotgr.add_subplot(111)

for a1,b1,c1,d1,angol in zipPARA:
fittedval = spock(logeels, a1, b1, c1, d1)
angli = str(angol)
imig = axius.plot(logeels, fittedval, label=angli)

axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.)
lotgr.canvas.draw()


On Mon, Feb 17, 2014 at 3:00 PM, Gabriele Brambilla 
gb.gabrielebrambi...@gmail.com wrote:

 Hi, I would like to set the color of the different plots with seaborn but
 I don't find examples of this kind on the tutorial.
 How could I modify this code? the zip() arguments are lists of the same
 dimension.

 zipPARA = zip(As, GAMMAs, EcutS, Bees, angles)

 lotgr = plt.figure()

 axius = lotgr.add_subplot(111)

 for a1,b1,c1,d1,angol in zipPARA:

 fittedval = spock(logeels, a1, b1, c1, d1)

 angli = str(angol)

 imig = axius.plot(logeels, fittedval, label=angli)

 axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.)

 lotgr.canvas.draw()

 thanks

 Gabriele


 2014-02-17 14:46 GMT-05:00 Paul Hobson pmhob...@gmail.com:

 Adam,

 Look into the seaborn project:

 http://nbviewer.ipython.org/github/mwaskom/seaborn/blob/master/examples/aesthetics.ipynb

 it's easy enough to define your own color palettes or select existing
 ones.
 -paul


 On Mon, Feb 17, 2014 at 11:41 AM, Adam Hughes hughesada...@gmail.comwrote:

 I'm wondering if the matplotlib API is designed in such a way that
 choosing a color schema could be done at import time.  I know that the
 entire plot style can be changed in one call (eg put plt.xkcd() at the
 beginning of your code), so I wander if colorblind-compatible colors could
 be loaded in a similar, quick way.


 On Mon, Feb 17, 2014 at 1:52 PM, ChaoYue chaoyue...@gmail.com wrote:

 Hi Gabriele,

 I'm afraid you have to put the numbers by yourself using the plt.text,
 as in an example:
 a = np.arange(10)
 b = np.tile(a,(10,1))
 c = np.tile(a[:,np.newaxis],(10)) + b
 plot(c)
 for i in range(10):
 plt.text(5,c[i][5],str(i))


 I've askd by a review to use the colorblind compatible colors when
 trying to submit a paper,
 and I find a website below:
 http://jfly.iam.u-tokyo.ac.jp/color/

 I put some RGB numbers for some colors here if you feel like to have a
 try:
 CCC =
 {

 'Black':np.array([0,0,0])/255.,

 'Orange':np.array([230,159,0])/255.,

 'Skyblue':np.array([85,180,233])/255.,

 'BluishGreen':np.array([0,158,115])/255.,

 'Yellow':np.array([240,228,66])/255.,

 'Blue':np.array([0,114,178])/255.,

 'Vermilion':np.array([213,94,0])/255.,

 'ReddishPurple':np.array([204,121,167])/255.
}

 Cheers,

 Chao



 On Mon, Feb 17, 2014 at 7:17 PM, Gabriele Brambilla [via matplotlib] 
 [hidden
 email] http://user/SendEmail.jtp?type=nodenode=42886i=0 wrote:

 Hi,
 I'm dealing with a guy that is colorblind.
 Have you got any suggestion on how could I show a plot like the one
 attached to him?
 Is there an option in pyplot that write little numbers near the curves
 instead of colors?

 thanks

 Gabriele

 --

 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=42884i=0
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 *daltonic.png* (181K) Download 
 Attachmenthttp://matplotlib.1069221.n5.nabble.com/attachment/42884/0/daltonic.png


 --
  If you reply to this email, your message will be added to the
 discussion below:

 http://matplotlib.1069221.n5.nabble.com/colorbllind-problem-tp42884.html
  To start a new topic under matplotlib - users, email [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=42886i=1
 To unsubscribe from matplotlib, click here.
 NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




 --

 ***
 Chao YUE
 Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
 UMR 1572 CEA-CNRS-UVSQ
 Batiment 712 - Pe 119
 91191 GIF Sur YVETTE Cedex
 Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16