[Matplotlib-users] streamplot: vectors not pointing in the right direction!
Hi, I have problems with streamplot I want to use a 3d vector field in coordinates (x,y,z) stored in a numpy array, and plot slices of it with streamplot. To test it I wanted to use a vector field with arrows pointed up in the z0 region and pointed down in the z0 region. import numpy as np import matplotlib.pyplot as plt from math import * max = 100 min = -100 X = np.linspace(min, max, num=100) Y = np.linspace(min, max, num=100) Z = np.linspace(min, max, num=100) N = X.size #single components in the 3D matrix Bxa = np.zeros((N, N, N)) Bya = np.zeros((N, N, N)) Bza = np.zeros((N, N, N)) for i, x in enumerate(X): for j, y in enumerate(Y): for k, z in enumerate(Z): Bxa[ i, j, k] = 0.0 #x Bya[ i, j, k] = 0.0 #y Bza[ i, j, k] = z #I take a slice close to Y=0 Bx_sec = Bxa[:,N/2,:] By_sec = Bya[:,N/2,:] Bz_sec = Bza[:,N/2,:] fig = plt.figure() ax = fig.add_subplot(111) ax.streamplot(X, Z, Bx_sec, Bz_sec, color='b') ax.set_xlim([X.min(), X.max()]) ax.set_ylim([Z.min(), Z.max()]) plt.show() But I obtain something that looks like if I have put Bza = x! I tried to invert the order of vectors but it is unuseful! I attach the picture. Do you understand why? (the code I posted should run) Gabriele -- One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] streamplot: vectors not pointing in the right direction!
Thanks! you are right! I didn't notice this detail Gabriele On Fri, May 22, 2015 at 3:58 PM, Benjamin Root ben.r...@ou.edu wrote: The documentation for streamplot: ``` *x*, *y* : 1d arrays an *evenly spaced* grid. *u*, *v* : 2d arrays x and y-velocities. Number of rows should match length of y, and the number of columns should match x. ``` Note that the rows in *u* and *v* should match *y*, and the columns should match *x*. I think your *u* and *v* are transposed. Cheers! Ben Root On Fri, May 22, 2015 at 2:50 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi, I have problems with streamplot I want to use a 3d vector field in coordinates (x,y,z) stored in a numpy array, and plot slices of it with streamplot. To test it I wanted to use a vector field with arrows pointed up in the z0 region and pointed down in the z0 region. import numpy as np import matplotlib.pyplot as plt from math import * max = 100 min = -100 X = np.linspace(min, max, num=100) Y = np.linspace(min, max, num=100) Z = np.linspace(min, max, num=100) N = X.size #single components in the 3D matrix Bxa = np.zeros((N, N, N)) Bya = np.zeros((N, N, N)) Bza = np.zeros((N, N, N)) for i, x in enumerate(X): for j, y in enumerate(Y): for k, z in enumerate(Z): Bxa[ i, j, k] = 0.0 #x Bya[ i, j, k] = 0.0 #y Bza[ i, j, k] = z #I take a slice close to Y=0 Bx_sec = Bxa[:,N/2,:] By_sec = Bya[:,N/2,:] Bz_sec = Bza[:,N/2,:] fig = plt.figure() ax = fig.add_subplot(111) ax.streamplot(X, Z, Bx_sec, Bz_sec, color='b') ax.set_xlim([X.min(), X.max()]) ax.set_ylim([Z.min(), Z.max()]) plt.show() But I obtain something that looks like if I have put Bza = x! I tried to invert the order of vectors but it is unuseful! I attach the picture. Do you understand why? (the code I posted should run) Gabriele -- One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] segmentation fault when saving images
Hi guys, I don't understand why now, after I save an image when it is prompted out, the image is not saved and it closes automatically and on the terminal appears segmentation fault. this is what my terminal shows: [gs66-stumbras:~/Desktop] gbrambil% python Bdipole.py Bdipole.py:52: RuntimeWarning: divide by zero encountered in divide lwb = 5/(np.log10(modB.max()/modB)) Bdipole.py:55: RuntimeWarning: divide by zero encountered in divide lwe = 5/(np.log10(modE.max()/modE)) Segmentation fault Thanks Gabriele -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] segmentation fault when saving images
Actually Paul Hobson was right. Now it works. Thanks Gabriele On Thu, Mar 19, 2015 at 1:19 PM, Benjamin Root ben.r...@ou.edu wrote: The warnings probably have nothing to do with the issue at hand. Try this. Install the package faulthandler and add the appropriate lines to your Bdipoly.py script and run it again. That way, we can get a traceback and find out where it is segfaulting from. http://faulthandler.readthedocs.org/en/latest/ Ben Root As a side-note: faulthandler is part of the standard library as of 3.3! Neat! On Thu, Mar 19, 2015 at 1:13 PM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi guys, I don't understand why now, after I save an image when it is prompted out, the image is not saved and it closes automatically and on the terminal appears segmentation fault. this is what my terminal shows: [gs66-stumbras:~/Desktop] gbrambil% python Bdipole.py Bdipole.py:52: RuntimeWarning: divide by zero encountered in divide lwb = 5/(np.log10(modB.max()/modB)) Bdipole.py:55: RuntimeWarning: divide by zero encountered in divide lwe = 5/(np.log10(modE.max()/modE)) Segmentation fault Thanks Gabriele -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] subplot axis ticks
Hi all, I'm trying to set the NUMBER of ticks on a subplot axis. Googling I'm finding only how to set the ticks values...but what if I don't know them and for visual reasons I would like to have a fixed number of ticks? thanks Gabriele -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] subplot axis ticks
Hi, I already saw that stack overflow page but this is my code: azal = rif.add_subplot(111) azal.plot(eels*(10**9), averspe, label='data') azal.plot(eels*(10**9), beck, label='fit') I tried to add both azal.yaxis.locator_params(nbins=4) or azal.locator_params(nbins=4) and it doesn't work. Gabriele On Thu, Dec 11, 2014 at 10:43 AM, Jody Klymak jkly...@uvic.ca wrote: http://stackoverflow.com/questions/6682784/how-to-reduce-number-of-ticks-with-matplotlib is the easy way. You can also write your own “Locators” that are more sophisticated if you have some ideas in mind (i.e. close to 5 ticks, but you’d prefer whole numbers, etc). http://matplotlib.org/1.4.2/examples/pylab_examples/major_minor_demo1.html Cheers, Jody On Dec 11, 2014, at 6:29 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi all, I'm trying to set the NUMBER of ticks on a subplot axis. Googling I'm finding only how to set the ticks values...but what if I don't know them and for visual reasons I would like to have a fixed number of ticks? thanks Gabriele -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] subplot axis ticks
Doing azal.locator_params(nbins=4) azal = rif.add_subplot(111) azal.plot(eels*(10**9), averspe, label='data') azal.plot(eels*(10**9), beck, label='fit') the program runs but locator_params doesn't do anything doing: azal.yaxis.locator_params(nbins=4) azal = rif.add_subplot(111) azal.plot(eels*(10**9), averspe, label='data') azal.plot(eels*(10**9), beck, label='fit') it continue to say that yaxis has not this attribute. Gabriele On Thu, Dec 11, 2014 at 11:07 AM, Benjamin Root ben.r...@ou.edu wrote: I wonder if setting the locator params prior to plotting would fix that? Might be one of those rare situations where the order of commands matter in matplotlib. Ben Root On Thu, Dec 11, 2014 at 10:50 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi, I already saw that stack overflow page but this is my code: azal = rif.add_subplot(111) azal.plot(eels*(10**9), averspe, label='data') azal.plot(eels*(10**9), beck, label='fit') I tried to add both azal.yaxis.locator_params(nbins=4) or azal.locator_params(nbins=4) and it doesn't work. Gabriele On Thu, Dec 11, 2014 at 10:43 AM, Jody Klymak jkly...@uvic.ca wrote: http://stackoverflow.com/questions/6682784/how-to-reduce-number-of-ticks-with-matplotlib is the easy way. You can also write your own “Locators” that are more sophisticated if you have some ideas in mind (i.e. close to 5 ticks, but you’d prefer whole numbers, etc). http://matplotlib.org/1.4.2/examples/pylab_examples/major_minor_demo1.html Cheers, Jody On Dec 11, 2014, at 6:29 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi all, I'm trying to set the NUMBER of ticks on a subplot axis. Googling I'm finding only how to set the ticks values...but what if I don't know them and for visual reasons I would like to have a fixed number of ticks? thanks Gabriele -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] subplot axis ticks
This guy helped me http://stackoverflow.com/questions/27425974/change-ticks-number-on-a-subplot/27426087?noredirect=1#comment43295472_27426087 thanks anyway Gabriele On Thu, Dec 11, 2014 at 11:18 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Doing azal.locator_params(nbins=4) azal = rif.add_subplot(111) azal.plot(eels*(10**9), averspe, label='data') azal.plot(eels*(10**9), beck, label='fit') the program runs but locator_params doesn't do anything doing: azal.yaxis.locator_params(nbins=4) azal = rif.add_subplot(111) azal.plot(eels*(10**9), averspe, label='data') azal.plot(eels*(10**9), beck, label='fit') it continue to say that yaxis has not this attribute. Gabriele On Thu, Dec 11, 2014 at 11:07 AM, Benjamin Root ben.r...@ou.edu wrote: I wonder if setting the locator params prior to plotting would fix that? Might be one of those rare situations where the order of commands matter in matplotlib. Ben Root On Thu, Dec 11, 2014 at 10:50 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi, I already saw that stack overflow page but this is my code: azal = rif.add_subplot(111) azal.plot(eels*(10**9), averspe, label='data') azal.plot(eels*(10**9), beck, label='fit') I tried to add both azal.yaxis.locator_params(nbins=4) or azal.locator_params(nbins=4) and it doesn't work. Gabriele On Thu, Dec 11, 2014 at 10:43 AM, Jody Klymak jkly...@uvic.ca wrote: http://stackoverflow.com/questions/6682784/how-to-reduce-number-of-ticks-with-matplotlib is the easy way. You can also write your own “Locators” that are more sophisticated if you have some ideas in mind (i.e. close to 5 ticks, but you’d prefer whole numbers, etc). http://matplotlib.org/1.4.2/examples/pylab_examples/major_minor_demo1.html Cheers, Jody On Dec 11, 2014, at 6:29 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi all, I'm trying to set the NUMBER of ticks on a subplot axis. Googling I'm finding only how to set the ticks values...but what if I don't know them and for visual reasons I would like to have a fixed number of ticks? thanks Gabriele -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Axes 3d scatter
If it returns this means that I have an older version? Traceback (most recent call last): File dataMODEL.py, line 99, in module ax.scatter(np.log10(NP), np.log10(NB*10**12), np.log10(NL), c='b', marker='o ', depthshade=False) File C:\Anaconda\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py, line 2180 , in scatter patches = Axes.scatter(self, xs, ys, s=s, c=c, *args, **kwargs) File C:\Anaconda\lib\site-packages\matplotlib\axes.py, line 6312, in scatter collection.update(kwargs) File C:\Anaconda\lib\site-packages\matplotlib\artist.py, line 739, in update raise AttributeError('Unknown property %s' % k) AttributeError: Unknown property depthshade 2014-09-22 17:27 GMT+02:00 Benjamin Root ben.r...@ou.edu: As of version 1.4.0, the 3d scatter plotting function gained the depthshade argument that you can set to false. http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html#scatter-plots Cheers! Ben Root On Mon, Sep 22, 2014 at 11:18 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi I'm trying to use a 3d scatter plot. import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib import cm fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.scatter(np.log10(NP), np.log10(NB*10**12), np.log10(NL), c='k') ax.scatter(np.log10(NPd), np.log10(NBd), np.log10(NLd), c='b') I would like that the dots that appear are all of the same color not in shades of black ('k') or shades of blue ('b') but I don't know how to do it. thanks Gabriele -- Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Fwd: multiplot in a for loop
No, if you look better near the zero there are some COLOURED lines: you have this impression because the values in EcutS are enormous respect the other one in GAMMAs and Bees. When you plot them all together the other ones disappear... I don't want to plot them all together. Excuse me but it's very difficult for me to give you a self running code: it's an enormous code with a lot of things that recall each others... Thanks Gabriele 2014-03-10 12:54 GMT-04:00 Paul Hobson pmhob...@gmail.com: Gabriele, I'm confused. I only see 1 series in each subplot. Could you trim your example down into some code that we can copy, paste, and run? A more thorough description of the problem might help too. -p On Mon, Mar 10, 2014 at 9:39 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi I'm trying to do a particular plot similar to this one: http://matplotlib.org/examples/pylab_examples/line_styles.html but my code pastes different datas in the same plot. I want only one array per each plot. I attach the wrong result fdatas = plt.figure() for filename in filenames: [various things] for obsangl in angles: [various things] #fitspectrum4.fitSpec is one my personal fitting routine pa0, era0, pa1, era1, pa2, era2, pa3, era3 = fitspectrum4.fitSpec(eels, averspe, (1.0)*(10**(-8)), 0.66, 10**6, 1) GAMMAs.append(pa1) EcutS.append(pa2) Bees.append(pa3) GeR.append(era1) EeR.append(era2) beR.append(era3) ialph += 1 ialpg = ialph axum1 = fdatas.add_subplot(numalp, 3, ialpg) da1 = axum1.errorbar(angles, GAMMAs, yerr=GeR, marker = .) ialpg = ialph + 1 axum2 = fdatas.add_subplot(numalp, 3, ialpg) da2 = axum2.errorbar(angles, EcutS, yerr=EeR, marker = .) ialpg = ialph + 2 axum3 = fdatas.add_subplot(numalp, 3, ialpg) da3 = axum3.errorbar(angles, Bees, yerr=beR, marker = .) thanks Gabriele -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] multiplot in a for loop
And how can I select in which position of the grid of plots put my errorbar plot? like axes[i].errorbar(...)? thanks Gabriele 2014-03-10 13:51 GMT-04:00 Paul Hobson pmhob...@gmail.com: So it sounds like you're not specifying the subplots correctly. I recommend using `fig, axes = plt.subplots(nrows=R, ncols=C)` as a replacement for `fig = plt.figure` and `fig.add_subplot()`. `axes` will be a numpy array of Axes objects through which you'll be able to loop along with your other variable. Good luck. -paul On Mon, Mar 10, 2014 at 10:46 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: No, if you look better near the zero there are some COLOURED lines: you have this impression because the values in EcutS are enormous respect the other one in GAMMAs and Bees. When you plot them all together the other ones disappear... I don't want to plot them all together. Excuse me but it's very difficult for me to give you a self running code: it's an enormous code with a lot of things that recall each others... Thanks Gabriele 2014-03-10 12:54 GMT-04:00 Paul Hobson pmhob...@gmail.com: Gabriele, I'm confused. I only see 1 series in each subplot. Could you trim your example down into some code that we can copy, paste, and run? A more thorough description of the problem might help too. -p On Mon, Mar 10, 2014 at 9:39 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi I'm trying to do a particular plot similar to this one: http://matplotlib.org/examples/pylab_examples/line_styles.html but my code pastes different datas in the same plot. I want only one array per each plot. I attach the wrong result fdatas = plt.figure() for filename in filenames: [various things] for obsangl in angles: [various things] #fitspectrum4.fitSpec is one my personal fitting routine pa0, era0, pa1, era1, pa2, era2, pa3, era3 = fitspectrum4.fitSpec(eels, averspe, (1.0)*(10**(-8)), 0.66, 10**6, 1) GAMMAs.append(pa1) EcutS.append(pa2) Bees.append(pa3) GeR.append(era1) EeR.append(era2) beR.append(era3) ialph += 1 ialpg = ialph axum1 = fdatas.add_subplot(numalp, 3, ialpg) da1 = axum1.errorbar(angles, GAMMAs, yerr=GeR, marker = .) ialpg = ialph + 1 axum2 = fdatas.add_subplot(numalp, 3, ialpg) da2 = axum2.errorbar(angles, EcutS, yerr=EeR, marker = .) ialpg = ialph + 2 axum3 = fdatas.add_subplot(numalp, 3, ialpg) da3 = axum3.errorbar(angles, Bees, yerr=beR, marker = .) thanks Gabriele -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] multiplot in a for loop
thank you guys, it works very well! Gabriele 2014-03-10 14:07 GMT-04:00 Joe Kington joferking...@gmail.com: On Mar 10, 2014 1:00 PM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: And how can I select in which position of the grid of plots put my errorbar plot? like axes[i].errorbar(...)? Exactly. Except that axes will be a 2d array if you have multiple rows and columns, so it would be axes[i,j].errorbar(...). If you just want to iterate over all of the subplots, use for ax in axes.flat:. Hope that helps, -Joe thanks Gabriele 2014-03-10 13:51 GMT-04:00 Paul Hobson pmhob...@gmail.com: So it sounds like you're not specifying the subplots correctly. I recommend using `fig, axes = plt.subplots(nrows=R, ncols=C)` as a replacement for `fig = plt.figure` and `fig.add_subplot()`. `axes` will be a numpy array of Axes objects through which you'll be able to loop along with your other variable. Good luck. -paul On Mon, Mar 10, 2014 at 10:46 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: No, if you look better near the zero there are some COLOURED lines: you have this impression because the values in EcutS are enormous respect the other one in GAMMAs and Bees. When you plot them all together the other ones disappear... I don't want to plot them all together. Excuse me but it's very difficult for me to give you a self running code: it's an enormous code with a lot of things that recall each others... Thanks Gabriele 2014-03-10 12:54 GMT-04:00 Paul Hobson pmhob...@gmail.com: Gabriele, I'm confused. I only see 1 series in each subplot. Could you trim your example down into some code that we can copy, paste, and run? A more thorough description of the problem might help too. -p On Mon, Mar 10, 2014 at 9:39 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi I'm trying to do a particular plot similar to this one: http://matplotlib.org/examples/pylab_examples/line_styles.html but my code pastes different datas in the same plot. I want only one array per each plot. I attach the wrong result fdatas = plt.figure() for filename in filenames: [various things] for obsangl in angles: [various things] #fitspectrum4.fitSpec is one my personal fitting routine pa0, era0, pa1, era1, pa2, era2, pa3, era3 = fitspectrum4.fitSpec(eels, averspe, (1.0)*(10**(-8)), 0.66, 10**6, 1) GAMMAs.append(pa1) EcutS.append(pa2) Bees.append(pa3) GeR.append(era1) EeR.append(era2) beR.append(era3) ialph += 1 ialpg = ialph axum1 = fdatas.add_subplot(numalp, 3, ialpg) da1 = axum1.errorbar(angles, GAMMAs, yerr=GeR, marker = .) ialpg = ialph + 1 axum2 = fdatas.add_subplot(numalp, 3, ialpg) da2 = axum2.errorbar(angles, EcutS, yerr=EeR, marker = .) ialpg = ialph + 2 axum3 = fdatas.add_subplot(numalp, 3, ialpg) da3 = axum3.errorbar(angles, Bees, yerr=beR, marker = .) thanks Gabriele -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Learn Graph Databases - Download FREE O'Reilly Book Graph Databases is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu
[Matplotlib-users] change ylim xlim from canvas doesn't work
Hi, when I try to change the ylim and xlim directly from the displayed canvas i get this error(when I change them in the code I have no problems): Traceback (most recent call last): File C:\Anaconda\lib\site-packages\matplotlib\backends\backend_qt4.py, line 594, in edit_parameters figureoptions.figure_edit(axes, self) File C:\Anaconda\lib\site-packages\matplotlib\backends\qt4_editor\figureoptio ns.py, line 134, in figure_edit icon=get_icon('qt4_editor_options.svg'), apply=apply_callback) File C:\Anaconda\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py, line 544, in fedit dialog = FormDialog(data, title, comment, icon, parent, apply) File C:\Anaconda\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py, line 461, in __init__ self.formwidget.setup() File C:\Anaconda\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py, line 433, in setup widget.setup() File C:\Anaconda\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py, line 408, in setup widget.setup() File C:\Anaconda\lib\site-packages\matplotlib\backends\qt4_editor\formlayout.py, line 302, in setup field = ColorLayout(QColor(value), self) TypeError: QVariant must be holding a QColor my code is: fig = plt.figure() figf = plt.figure() for el in sequence: #some operations ax = fig.add_subplot(111) img = ax.plot(xflo, yflo, label=etich, marker = '.') ax.set_yscale('log') ax.set_xscale('log') ax.legend(bbox_to_anchor=(1.05, 1), loc=4, borderaxespad=0.) fig.canvas.draw() ax1 = figf.add_subplot(111) img1 = ax1.plot(logx, logy, label=etich)#, marker = style) ax1.legend(bbox_to_anchor=(1.05, 1), loc=4, borderaxespad=0.) figf.canvas.draw() thanks Gabriele -- Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/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
it works indexing the palette. thanks Gabriele 2014-02-18 13:57 GMT-05:00 Paul Hobson pmhob...@gmail.com: Try specifying the color explicitly from the palette object: import numpy as np import matplotlib.pyplot as plt import pandas import seaborn myPalet1 = seaborn.color_palette(RdPu_r, 10) seaborn.set_color_palette(myPalet1) x = np.linspace(start=0, stop=5, num=100) fig, ax = plt.subplots() for n, slope in enumerate(np.linspace(start=0, stop=5, num=10)): ax.plot(x, slope*x**2, color=myPalet1[n]) On Tue, Feb 18, 2014 at 10:30 AM, Gabriele Brambilla gb.gabrielebrambi...@gmail.com wrote: Hi, I get right one plot, but this other one works in a strange way: it restarts to give the darker color to a line. I would like to assign the colors in the right order so the colorblind guy that works with me could see the differences like a light growing. (I attach the image) do you understand where am I doing wrong? (before this piece of code I use other color palette but I think they have no effect on the following ones) zipPARApha = zip(Pampli, Pgamma, Pecut, Pb, g) myPalet1 = sns.color_palette(RdPu_r, 10) sns.set_color_palette(myPalet1) lotgr = plt.figure() axius = lotgr.add_subplot(111) for n, (a1,b1,c1,d1,pha) in enumerate(zipPARApha): if n % 18 == 0: fittedval = spock(logeels, a1, b1, c1, d1) phaint = int(pha) angli = str(phaint) imig = axius.plot(logeels, fittedval, label=angli) axius.set_title('phase resolved spectra, ' + lightitle) axius.set_ylim([-100, 1]) axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.) lotgr.canvas.draw() thanks Gabriele 2014-02-18 10:47 GMT-05:00 Gabriele Brambilla gb.gabrielebrambi...@gmail.com: it works, thank you. Using a color palette that changes only the intensity/light of the color (all blue lines) helps. Gabriele 2014-02-17 20:57 GMT-05:00 Paul Hobson pmhob...@gmail.com: 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.com wrote: 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.comwrote: 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
Re: [Matplotlib-users] colorbllind problem
it works, thank you. Using a color palette that changes only the intensity/light of the color (all blue lines) helps. Gabriele 2014-02-17 20:57 GMT-05:00 Paul Hobson pmhob...@gmail.com: 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
Re: [Matplotlib-users] colorbllind problem
Hi, I get right one plot, but this other one works in a strange way: it restarts to give the darker color to a line. I would like to assign the colors in the right order so the colorblind guy that works with me could see the differences like a light growing. (I attach the image) do you understand where am I doing wrong? (before this piece of code I use other color palette but I think they have no effect on the following ones) zipPARApha = zip(Pampli, Pgamma, Pecut, Pb, g) myPalet1 = sns.color_palette(RdPu_r, 10) sns.set_color_palette(myPalet1) lotgr = plt.figure() axius = lotgr.add_subplot(111) for n, (a1,b1,c1,d1,pha) in enumerate(zipPARApha): if n % 18 == 0: fittedval = spock(logeels, a1, b1, c1, d1) phaint = int(pha) angli = str(phaint) imig = axius.plot(logeels, fittedval, label=angli) axius.set_title('phase resolved spectra, ' + lightitle) axius.set_ylim([-100, 1]) axius.legend(bbox_to_anchor=(1.05, 1), loc=9, borderaxespad=0.) lotgr.canvas.draw() thanks Gabriele 2014-02-18 10:47 GMT-05:00 Gabriele Brambilla gb.gabrielebrambi...@gmail.com: it works, thank you. Using a color palette that changes only the intensity/light of the color (all blue lines) helps. Gabriele 2014-02-17 20:57 GMT-05:00 Paul Hobson pmhob...@gmail.com: 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=0wrote: 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
Re: [Matplotlib-users] colorbllind problem
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