You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Matteo N. <ma...@my...> - 2015-05-21 21:28:32
|
OK, I understand. Could you suggest a way to reduce that 3D array to a 2D array and plot it with a specific colormap, while preserving the shading? I did something similar in Matlab https://mycarta.wordpress.com/2012/04/05/visualization-tips-for-geoscientists-matlab-part-ii/ But it took using some custom functions and a ton of asking and tinkering, and I'm not quite at that level with matplotlib, so any suggestion would be appreciated Thanks, Matteo On Thu, May 21, 2015 4:10 pm, Eric Firing wrote: > > Colormapping occurs only when you give imshow a 2-D array of numbers to > be mapped; when you feed it a 3-D array of RGB values, it simply shows > those colors. For colormapping to occur, it must be done on a 2-D array > as a step leading up to the generation of your img_array. > > Eric > On 2015/05/21 5:50 AM, Matteo Niccoli wrote: > >> I posted a question on stackoverflow about creating with making my own >> shading effect (I want to use horizontal gradient for the shading). >> http://stackoverflow.com/questions/30310002/issue-creating-map-shading- >> in-matplotlib-imshow-by-setting-opacity-to-data-gradi >> >> >> Unfortunately I cannot share the data because I am using it for a >> manuscripts, but my notebook with full code listing and plots, here: >> http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/surfa >> ce_shading.ipynb/%3Fdl%3D0 >> >> The shading using gradient is implemented in two ways as suggested in >> the answer. What I do not understand is why the last plot comes out with >> a rainbow-like colors, when I did specify cubehelix as colormap. >> >> hsv = cl.rgb_to_hsv(img_array[:, :, :3]) hsv[:, :, 2] = tdx_n >> rgb = cl.hsv_to_rgb(hsv) plt.imshow(rgb[4:-3,4:-3], cmap='cubehelix') >> plt.show() >> >> >> Am I doing something wrong or is this unexpected behavior; is there a >> workaround? > >> >> Thanks >> Matteo >> >> > > > ------------------------------------------------------------------------- > ----- > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Eric F. <ef...@ha...> - 2015-05-21 20:10:18
|
On 2015/05/21 5:50 AM, Matteo Niccoli wrote: > I posted a question on stackoverflow about creating with making my own > shading effect (I want to use horizontal gradient for the shading). > http://stackoverflow.com/questions/30310002/issue-creating-map-shading-in-matplotlib-imshow-by-setting-opacity-to-data-gradi > > > Unfortunately I cannot share the data because I am using it for a > manuscripts, but my notebook with full code listing and plots, here: > http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/surface_shading.ipynb/%3Fdl%3D0 > > The shading using gradient is implemented in two ways as suggested in the > answer. What I do not understand is why the last plot comes out with a > rainbow-like colors, when I did specify cubehelix as colormap. > > hsv = cl.rgb_to_hsv(img_array[:, :, :3]) > hsv[:, :, 2] = tdx_n > rgb = cl.hsv_to_rgb(hsv) > plt.imshow(rgb[4:-3,4:-3], cmap='cubehelix') > plt.show() > > > Am I doing something wrong or is this unexpected behavior; is there a > workaround? Colormapping occurs only when you give imshow a 2-D array of numbers to be mapped; when you feed it a 3-D array of RGB values, it simply shows those colors. For colormapping to occur, it must be done on a 2-D array as a step leading up to the generation of your img_array. Eric > > Thanks > Matteo > |
From: Bryan W. <bry...@gm...> - 2015-05-21 20:08:18
|
Good afternoon, My name is Bryan Williams. I work for the Florida Forest Service in their Forest Logistics and Support Bureau. I’m working on a program that takes weather data and visualizes it using matplotlib and Basemap. I’m currently having an issue with matplotlib 1.4.3 for Python 3.4.3 running under Solaris 5.10. I am getting a Runtime Error whenever I try calling the read_png file from matplotlib._png. (I’m using this to add a small .png file of the Forest Service’s sheld to the picture). The error is the following: Traceback (most recent call last): File "drawmaps.py", line 845, in <module> arr_lena = read_png(fn) RuntimeError: Error closing dupe file handle I don’t quite understand the error I’m getting, and as you can see, the traceback gives very little information. I also tried Google for help, but to no avail; entering the error message as is into Google doesn’t return anything relating to the problem, and putting quotes around “Error closing dupe file handle” yields about 10 results, with one of them being an unanswered question from 2014 regarding the same issue. As per your request on the website, here’s what I get from uname –a: SunOS [server name withheld] 5.10 Generic_141444-09 sun4v sparc SUNW,SPARC-Enterprise-T5220 I built Python 3.4.3 from source and installed matplotlib through pip, and didn’t make any changes to the matplotlibrc file. I was able to reproduce the problem again running these commands in the Python interactive prompt, which emulates the snippet of script that causes the error: Python 3.4.3 (default, May 15 2015, 13:52:23) [GCC 4.9.2] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> from matplotlib._png import read_png >>> from matplotlib.cbook import get_sample_data >>> import os; path=os.getcwd() >>> fn = get_sample_data(path + '/resources/shield.png', asfileobj=False) >>> arr_lena = read_png(fn) Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: Error closing dupe file handle If you’d like a copy of the problem script, please let me know. Any and all help is greatly appreciated. Thank you in advance! -- BMW |
From: Benjamin R. <ben...@ou...> - 2015-05-21 19:22:01
|
I think you want figimage(): http://matplotlib.org/examples/pylab_examples/figimage_demo.html I use it all the time for adding the company's logo to graphs. Keep in mind that it will plot the unsampled version of the image, so the final result depends on the figure size and resolution. I hope that helps! Ben Root On Wed, May 20, 2015 at 7:43 AM, aradand <ara...@gm...> wrote: > I'm trying to plot an image on top of a Figure, but imshow seems to always > distort the size of the axes. What I want is that the lower part of the top > image stay always in the same position, for any image height > > This minimal example shows my issue > > import matplotlib.pyplot as plt > import numpy as np > > fig = plt.figure() > ax = fig.add_axes([0.1, 0, 1, 1]) > > # Top figure aligned with the bottom figure > # keeping the same width (?) > ax2 = fig.add_axes([0.1, 1, 1, 1]) > ax2.set_xticks([]) > > # Depending on the number of rows or columns > # the top image will be moved further to the top > # or will be stretched if rows > columns > # I dont know how to control this to stay always > # with the same separation with respect > # to the bottom figure and keeping the same width > # (so the frame is the same width than the bottom figure) > im = np.random.rand(10, 30) > ax2.imshow(im) > plt.plot() > > If it is possible to > > I would prefer to avoid using subplots or grid, since I have already > specified a lot of things using the add_axes method. > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Fixing-axes-for-imshow-plot-on-top-of-a-figure-tp45579.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Goyo <goy...@gm...> - 2015-05-21 19:09:16
|
I do not think fig.add_axes([0.1, 1, 1, 1]) makes any sense. The docstring says: fig.add_axes(*args, **kwargs) Add an axes at position *rect* [*left*, *bottom*, *width*, *height*] where all quantities are in fractions of figure width and height. If bottom and height are both 1 you need the height of the figure to be 2 in fractions of figure height. This means 1 must equal 2 and then Bertrand Russel must be the Pope[1]. Goyo [1] http://ceadserv1.nku.edu/longa//classes/mat385_resources/docs/russellpope.html 2015-05-20 13:43 GMT+02:00 aradand <ara...@gm...>: > I'm trying to plot an image on top of a Figure, but imshow seems to always > distort the size of the axes. What I want is that the lower part of the top > image stay always in the same position, for any image height > > This minimal example shows my issue > > import matplotlib.pyplot as plt > import numpy as np > > fig = plt.figure() > ax = fig.add_axes([0.1, 0, 1, 1]) > > # Top figure aligned with the bottom figure > # keeping the same width (?) > ax2 = fig.add_axes([0.1, 1, 1, 1]) > ax2.set_xticks([]) > > # Depending on the number of rows or columns > # the top image will be moved further to the top > # or will be stretched if rows > columns > # I dont know how to control this to stay always > # with the same separation with respect > # to the bottom figure and keeping the same width > # (so the frame is the same width than the bottom figure) > im = np.random.rand(10, 30) > ax2.imshow(im) > plt.plot() > > If it is possible to > > I would prefer to avoid using subplots or grid, since I have already > specified a lot of things using the add_axes method. > > > > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/Fixing-axes-for-imshow-plot-on-top-of-a-figure-tp45579.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Matteo N. <ma...@my...> - 2015-05-21 17:07:50
|
I posted a question on stackoverflow about creating with making my own shading effect (I want to use horizontal gradient for the shading). http://stackoverflow.com/questions/30310002/issue-creating-map-shading-in-matplotlib-imshow-by-setting-opacity-to-data-gradi Unfortunately I cannot share the data because I am using it for a manuscripts, but my notebook with full code listing and plots, here: http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/surface_shading.ipynb/%3Fdl%3D0 The shading using gradient is implemented in two ways as suggested in the answer. What I do not understand is why the last plot comes out with a rainbow-like colors, when I did specify cubehelix as colormap. hsv = cl.rgb_to_hsv(img_array[:, :, :3]) hsv[:, :, 2] = tdx_n rgb = cl.hsv_to_rgb(hsv) plt.imshow(rgb[4:-3,4:-3], cmap='cubehelix') plt.show() Am I doing something wrong or is this unexpected behavior; is there a workaround? Thanks Matteo |
From: Benjamin R. <ben...@ou...> - 2015-05-21 16:11:20
|
Sorry, it is "line_collection_2d_to_3d()". On Thu, May 21, 2015 at 12:02 PM, Raj Kumar Manna <raj...@gm...> wrote: > Its giving a error, > > art3d.linecollection_2d_to_3d(stream.lines) > AttributeError: 'module' object has no attribute 'linecollection_2d_to_3d' > > > > Here is my script, > > > import matplotlib.pyplot as plt > from matplotlib.patches import Circle, PathPatch > from mpl_toolkits.mplot3d import Axes3D > import mpl_toolkits.mplot3d.art3d as art3d > import numpy as np > from pylab import * > from matplotlib.collections import LineCollection > > > > fig = plt.figure() > ax=fig.gca(projection='3d') > > > f=np.loadtxt('flow-velocity343.dat') > dx,dz=1.0,1.0 > > xmin,zmin,xmax,zmax=min(f[:,0]),min(f[:,2]),max(f[:,0]),max(f[:,2]) > nbinx,nbinz=int((xmax-xmin)/dx)+1,int((zmax-zmin)/dz)+1 > Ux=np.zeros([nbinz,nbinx],'d') > Uy=np.zeros([nbinz,nbinx],'d') > Uz=np.zeros([nbinz,nbinx],'d') > speed=np.zeros([nbinz,nbinx],'d') > logv=np.zeros([nbinz,nbinx],'d') > > > > for f1 in f: > binx,binz=int((f1[0]-xmin)/dx),int((f1[2]-zmin)/dz) > Ux[binz][binx]=f1[3] > Uy[binz][binx]=f1[4] > Uz[binz][binx]=f1[5] > speed[binz][binx] = np.sqrt( Ux[binz][binx]*Ux[binz][binx] + > Uz[binz][binx]*Uz[binz][binx] + Uy[binz][binx]*Uy[binz][binx] ) > logv[binz][binx] = log(speed[binz][binx]) > x,z=np.arange(xmin,xmax+dx,dx),np.arange(zmin,zmax+dz,dz) > y=np.arange(0,71,1) > X,Z=np.meshgrid(x,z) > > stream = ax.streamplot(X, Z, Ux, Uz, color='black', linewidth=2) > #lines = stream.lines.get_paths() > > art3d.linecollection_2d_to_3d(stream.lines) > for p in stream.arrows: > art3d.patch_2d_to_3d(p) > > > > plt.show() > > > > > > Thanks > Raj > > > On Thu, May 21, 2015 at 9:19 PM, Benjamin Root <ben...@ou...> wrote: > >> (keeping the discussion on the mailing list) >> >> The object you get back have two attributes: "lines" and "arrows". This >> is just psuedo-code, but it would look something like this: >> >> ``` >> stream = ax.streamplot(......) >> art3d.linecollection_2d_to_3d(stream.lines, ....) >> for p in stream.arrows: >> art3d.patch_2d_to_3d(p, ...) >> ``` >> Again, I have no clue if this actually would work. I haven't tried doing >> this myself. >> >> Ben Root >> >> On Thu, May 21, 2015 at 11:39 AM, Raj Kumar Manna < >> raj...@gm...> wrote: >> >>> Thanks for your quick reply. >>> >>> I have plotted the streamplot in 2d . I am not able to extract lines or >>> arrow from streamplot. I am new user of matplotlib, can you please tell me >>> the syntax to extract lines and arrows from streamplot(). >>> >>> Thanks for you help. >>> Raj >>> >>> On Thu, May 21, 2015 at 8:30 PM, Benjamin Root <ben...@ou...> wrote: >>> >>>> Well, there is the new 3D quiver feature: >>>> http://matplotlib.org/examples/mplot3d/quiver3d_demo.html. Not quite >>>> streamlines, but it might do in a pinch. >>>> >>>> Another approach: >>>> There is the 2d streamplot() function that returns a specialized >>>> object. From the docstring: >>>> ``` >>>> Returns: >>>> >>>> *stream_container* : StreamplotSet >>>> Container object with attributes >>>> >>>> - lines: `matplotlib.collections.LineCollection` of >>>> streamlines >>>> >>>> - arrows: collection of >>>> `matplotlib.patches.FancyArrowPatch` >>>> objects representing arrows half-way along stream >>>> lines. >>>> ``` >>>> >>>> You might be able to get away with using the "lines" object and feeding >>>> it through art3d.line_collection_2d_to_3d(), kind of like how it is done >>>> for pathpatch objects here: >>>> http://matplotlib.org/examples/mplot3d/pathpatch3d_demo.html. You >>>> might also be able to pass the individual objects in the "arrows" list >>>> through art3d.patch_2d_to_3d(), but I have no clue if that would actually >>>> work or not. >>>> >>>> I hope that helps! >>>> Ben Root >>>> >>>> >>>> On Thu, May 21, 2015 at 7:45 AM, Raj Kumar Manna < >>>> raj...@gm...> wrote: >>>> >>>>> Hi, >>>>> >>>>> I need to plot a 2d streamline in 3d view like this >>>>> <http://stackoverflow.com/questions/14963004/continuous-shades-on-matplotlib-3d-surface>. >>>>> As suggested by the post >>>>> <http://stackoverflow.com/questions/16252231/symmetric-streamplot-with-matplotlib/16373060#16373060>, >>>>> I need to extract streamlines and arrows from a 2d plot and then transform >>>>> it to 3d data. How to transform this 2d streamline data to 3d data and plot >>>>> using mplot3d? >>>>> >>>>> Thanks in advance. >>>>> >>>>> Raj >>>>> >>>>> >>>>> -- >>>>> ################################################################## >>>>> Raj Kumar Manna >>>>> Complex Fluid & Biological Physics Lab >>>>> IIT Madras >>>>> >>>>> Ph. No. 8144637401 >>>>> >>>>> alternate email: ra...@ph... <raj...@gm...> >>>>> #################################################################### >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> 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 >>>>> Mat...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>>> >>>>> >>>> >>> >>> >>> -- >>> ################################################################## >>> Raj Kumar Manna >>> Complex Fluid & Biological Physics Lab >>> IIT Madras >>> >>> Ph. No. 8144637401 >>> >>> alternate email: ra...@ph... <raj...@gm...> >>> #################################################################### >>> >> >> > > > -- > ################################################################## > Raj Kumar Manna > Complex Fluid & Biological Physics Lab > IIT Madras > > Ph. No. 8144637401 > > alternate email: ra...@ph... <raj...@gm...> > #################################################################### > |
From: Raj K. M. <raj...@gm...> - 2015-05-21 16:02:51
|
Its giving a error, art3d.linecollection_2d_to_3d(stream.lines) AttributeError: 'module' object has no attribute 'linecollection_2d_to_3d' Here is my script, import matplotlib.pyplot as plt from matplotlib.patches import Circle, PathPatch from mpl_toolkits.mplot3d import Axes3D import mpl_toolkits.mplot3d.art3d as art3d import numpy as np from pylab import * from matplotlib.collections import LineCollection fig = plt.figure() ax=fig.gca(projection='3d') f=np.loadtxt('flow-velocity343.dat') dx,dz=1.0,1.0 xmin,zmin,xmax,zmax=min(f[:,0]),min(f[:,2]),max(f[:,0]),max(f[:,2]) nbinx,nbinz=int((xmax-xmin)/dx)+1,int((zmax-zmin)/dz)+1 Ux=np.zeros([nbinz,nbinx],'d') Uy=np.zeros([nbinz,nbinx],'d') Uz=np.zeros([nbinz,nbinx],'d') speed=np.zeros([nbinz,nbinx],'d') logv=np.zeros([nbinz,nbinx],'d') for f1 in f: binx,binz=int((f1[0]-xmin)/dx),int((f1[2]-zmin)/dz) Ux[binz][binx]=f1[3] Uy[binz][binx]=f1[4] Uz[binz][binx]=f1[5] speed[binz][binx] = np.sqrt( Ux[binz][binx]*Ux[binz][binx] + Uz[binz][binx]*Uz[binz][binx] + Uy[binz][binx]*Uy[binz][binx] ) logv[binz][binx] = log(speed[binz][binx]) x,z=np.arange(xmin,xmax+dx,dx),np.arange(zmin,zmax+dz,dz) y=np.arange(0,71,1) X,Z=np.meshgrid(x,z) stream = ax.streamplot(X, Z, Ux, Uz, color='black', linewidth=2) #lines = stream.lines.get_paths() art3d.linecollection_2d_to_3d(stream.lines) for p in stream.arrows: art3d.patch_2d_to_3d(p) plt.show() Thanks Raj On Thu, May 21, 2015 at 9:19 PM, Benjamin Root <ben...@ou...> wrote: > (keeping the discussion on the mailing list) > > The object you get back have two attributes: "lines" and "arrows". This is > just psuedo-code, but it would look something like this: > > ``` > stream = ax.streamplot(......) > art3d.linecollection_2d_to_3d(stream.lines, ....) > for p in stream.arrows: > art3d.patch_2d_to_3d(p, ...) > ``` > Again, I have no clue if this actually would work. I haven't tried doing > this myself. > > Ben Root > > On Thu, May 21, 2015 at 11:39 AM, Raj Kumar Manna < > raj...@gm...> wrote: > >> Thanks for your quick reply. >> >> I have plotted the streamplot in 2d . I am not able to extract lines or >> arrow from streamplot. I am new user of matplotlib, can you please tell me >> the syntax to extract lines and arrows from streamplot(). >> >> Thanks for you help. >> Raj >> >> On Thu, May 21, 2015 at 8:30 PM, Benjamin Root <ben...@ou...> wrote: >> >>> Well, there is the new 3D quiver feature: >>> http://matplotlib.org/examples/mplot3d/quiver3d_demo.html. Not quite >>> streamlines, but it might do in a pinch. >>> >>> Another approach: >>> There is the 2d streamplot() function that returns a specialized object. >>> From the docstring: >>> ``` >>> Returns: >>> >>> *stream_container* : StreamplotSet >>> Container object with attributes >>> >>> - lines: `matplotlib.collections.LineCollection` of >>> streamlines >>> >>> - arrows: collection of >>> `matplotlib.patches.FancyArrowPatch` >>> objects representing arrows half-way along stream >>> lines. >>> ``` >>> >>> You might be able to get away with using the "lines" object and feeding >>> it through art3d.line_collection_2d_to_3d(), kind of like how it is done >>> for pathpatch objects here: >>> http://matplotlib.org/examples/mplot3d/pathpatch3d_demo.html. You might >>> also be able to pass the individual objects in the "arrows" list through >>> art3d.patch_2d_to_3d(), but I have no clue if that would actually work or >>> not. >>> >>> I hope that helps! >>> Ben Root >>> >>> >>> On Thu, May 21, 2015 at 7:45 AM, Raj Kumar Manna < >>> raj...@gm...> wrote: >>> >>>> Hi, >>>> >>>> I need to plot a 2d streamline in 3d view like this >>>> <http://stackoverflow.com/questions/14963004/continuous-shades-on-matplotlib-3d-surface>. >>>> As suggested by the post >>>> <http://stackoverflow.com/questions/16252231/symmetric-streamplot-with-matplotlib/16373060#16373060>, >>>> I need to extract streamlines and arrows from a 2d plot and then transform >>>> it to 3d data. How to transform this 2d streamline data to 3d data and plot >>>> using mplot3d? >>>> >>>> Thanks in advance. >>>> >>>> Raj >>>> >>>> >>>> -- >>>> ################################################################## >>>> Raj Kumar Manna >>>> Complex Fluid & Biological Physics Lab >>>> IIT Madras >>>> >>>> Ph. No. 8144637401 >>>> >>>> alternate email: ra...@ph... <raj...@gm...> >>>> #################################################################### >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> 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 >>>> Mat...@li... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >>>> >>> >> >> >> -- >> ################################################################## >> Raj Kumar Manna >> Complex Fluid & Biological Physics Lab >> IIT Madras >> >> Ph. No. 8144637401 >> >> alternate email: ra...@ph... <raj...@gm...> >> #################################################################### >> > > -- ################################################################## Raj Kumar Manna Complex Fluid & Biological Physics Lab IIT Madras Ph. No. 8144637401 alternate email: ra...@ph... <raj...@gm...> #################################################################### |
From: Benjamin R. <ben...@ou...> - 2015-05-21 15:49:41
|
(keeping the discussion on the mailing list) The object you get back have two attributes: "lines" and "arrows". This is just psuedo-code, but it would look something like this: ``` stream = ax.streamplot(......) art3d.linecollection_2d_to_3d(stream.lines, ....) for p in stream.arrows: art3d.patch_2d_to_3d(p, ...) ``` Again, I have no clue if this actually would work. I haven't tried doing this myself. Ben Root On Thu, May 21, 2015 at 11:39 AM, Raj Kumar Manna <raj...@gm...> wrote: > Thanks for your quick reply. > > I have plotted the streamplot in 2d . I am not able to extract lines or > arrow from streamplot. I am new user of matplotlib, can you please tell me > the syntax to extract lines and arrows from streamplot(). > > Thanks for you help. > Raj > > On Thu, May 21, 2015 at 8:30 PM, Benjamin Root <ben...@ou...> wrote: > >> Well, there is the new 3D quiver feature: >> http://matplotlib.org/examples/mplot3d/quiver3d_demo.html. Not quite >> streamlines, but it might do in a pinch. >> >> Another approach: >> There is the 2d streamplot() function that returns a specialized object. >> From the docstring: >> ``` >> Returns: >> >> *stream_container* : StreamplotSet >> Container object with attributes >> >> - lines: `matplotlib.collections.LineCollection` of >> streamlines >> >> - arrows: collection of >> `matplotlib.patches.FancyArrowPatch` >> objects representing arrows half-way along stream >> lines. >> ``` >> >> You might be able to get away with using the "lines" object and feeding >> it through art3d.line_collection_2d_to_3d(), kind of like how it is done >> for pathpatch objects here: >> http://matplotlib.org/examples/mplot3d/pathpatch3d_demo.html. You might >> also be able to pass the individual objects in the "arrows" list through >> art3d.patch_2d_to_3d(), but I have no clue if that would actually work or >> not. >> >> I hope that helps! >> Ben Root >> >> >> On Thu, May 21, 2015 at 7:45 AM, Raj Kumar Manna < >> raj...@gm...> wrote: >> >>> Hi, >>> >>> I need to plot a 2d streamline in 3d view like this >>> <http://stackoverflow.com/questions/14963004/continuous-shades-on-matplotlib-3d-surface>. >>> As suggested by the post >>> <http://stackoverflow.com/questions/16252231/symmetric-streamplot-with-matplotlib/16373060#16373060>, >>> I need to extract streamlines and arrows from a 2d plot and then transform >>> it to 3d data. How to transform this 2d streamline data to 3d data and plot >>> using mplot3d? >>> >>> Thanks in advance. >>> >>> Raj >>> >>> >>> -- >>> ################################################################## >>> Raj Kumar Manna >>> Complex Fluid & Biological Physics Lab >>> IIT Madras >>> >>> Ph. No. 8144637401 >>> >>> alternate email: ra...@ph... <raj...@gm...> >>> #################################################################### >>> >>> >>> ------------------------------------------------------------------------------ >>> 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 >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> > > > -- > ################################################################## > Raj Kumar Manna > Complex Fluid & Biological Physics Lab > IIT Madras > > Ph. No. 8144637401 > > alternate email: ra...@ph... <raj...@gm...> > #################################################################### > |
From: Benjamin R. <ben...@ou...> - 2015-05-21 15:01:05
|
Well, there is the new 3D quiver feature: http://matplotlib.org/examples/mplot3d/quiver3d_demo.html. Not quite streamlines, but it might do in a pinch. Another approach: There is the 2d streamplot() function that returns a specialized object. >From the docstring: ``` Returns: *stream_container* : StreamplotSet Container object with attributes - lines: `matplotlib.collections.LineCollection` of streamlines - arrows: collection of `matplotlib.patches.FancyArrowPatch` objects representing arrows half-way along stream lines. ``` You might be able to get away with using the "lines" object and feeding it through art3d.line_collection_2d_to_3d(), kind of like how it is done for pathpatch objects here: http://matplotlib.org/examples/mplot3d/pathpatch3d_demo.html. You might also be able to pass the individual objects in the "arrows" list through art3d.patch_2d_to_3d(), but I have no clue if that would actually work or not. I hope that helps! Ben Root On Thu, May 21, 2015 at 7:45 AM, Raj Kumar Manna <raj...@gm...> wrote: > Hi, > > I need to plot a 2d streamline in 3d view like this > <http://stackoverflow.com/questions/14963004/continuous-shades-on-matplotlib-3d-surface>. > As suggested by the post > <http://stackoverflow.com/questions/16252231/symmetric-streamplot-with-matplotlib/16373060#16373060>, > I need to extract streamlines and arrows from a 2d plot and then transform > it to 3d data. How to transform this 2d streamline data to 3d data and plot > using mplot3d? > > Thanks in advance. > > Raj > > > -- > ################################################################## > Raj Kumar Manna > Complex Fluid & Biological Physics Lab > IIT Madras > > Ph. No. 8144637401 > > alternate email: ra...@ph... <raj...@gm...> > #################################################################### > > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Albrecht, J. <Jan...@en...> - 2015-05-21 11:50:40
|
Hi dear all, I have installed matplot and also six.py and so on. If i start an example from matplot i get the following eror message: File "C:\Python26\lib\site-packages\matplotlib\pyplot.py", line 1087, in subplots ax0 = fig.add_subplot(gs[0, 0], **subplot_kw) File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 964, in add_subplot a = subplot_class_factory(projection_class)(self, *args, **kwargs) File "C:\Python26\lib\site-packages\matplotlib\axes\_subplots.py", line 75, in __init__ self.update_params() File "C:\Python26\lib\site-packages\matplotlib\axes\_subplots.py", line 115, in update_params return_all=True) File "C:\Python26\lib\site-packages\matplotlib\gridspec.py", line 425, in get_position gridspec.get_grid_positions(fig) File "C:\Python26\lib\site-packages\matplotlib\gridspec.py", line 86, in get_grid_positions subplot_params = self.get_subplot_params(fig) File "C:\Python26\lib\site-packages\matplotlib\gridspec.py", line 271, in get_subplot_params subplotpars.update(**update_kw) TypeError: update() keywords must be strings Maybe someone can help me, thanks a lot JAn |
From: Raj K. M. <raj...@gm...> - 2015-05-21 11:45:38
|
Hi, I need to plot a 2d streamline in 3d view like this <http://stackoverflow.com/questions/14963004/continuous-shades-on-matplotlib-3d-surface>. As suggested by the post <http://stackoverflow.com/questions/16252231/symmetric-streamplot-with-matplotlib/16373060#16373060>, I need to extract streamlines and arrows from a 2d plot and then transform it to 3d data. How to transform this 2d streamline data to 3d data and plot using mplot3d? Thanks in advance. Raj -- ################################################################## Raj Kumar Manna Complex Fluid & Biological Physics Lab IIT Madras Ph. No. 8144637401 alternate email: ra...@ph... <raj...@gm...> #################################################################### |
From: aradand <ara...@gm...> - 2015-05-20 11:44:01
|
I'm trying to plot an image on top of a Figure, but imshow seems to always distort the size of the axes. What I want is that the lower part of the top image stay always in the same position, for any image height This minimal example shows my issue import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_axes([0.1, 0, 1, 1]) # Top figure aligned with the bottom figure # keeping the same width (?) ax2 = fig.add_axes([0.1, 1, 1, 1]) ax2.set_xticks([]) # Depending on the number of rows or columns # the top image will be moved further to the top # or will be stretched if rows > columns # I dont know how to control this to stay always # with the same separation with respect # to the bottom figure and keeping the same width # (so the frame is the same width than the bottom figure) im = np.random.rand(10, 30) ax2.imshow(im) plt.plot() If it is possible to I would prefer to avoid using subplots or grid, since I have already specified a lot of things using the add_axes method. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Fixing-axes-for-imshow-plot-on-top-of-a-figure-tp45579.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Thomas C. <tca...@gm...> - 2015-05-20 02:01:19
|
What are you plotting? How big is this list that the loops are taking appreciable amounts of time?!? Are we talking seconds here or ms? Have you done enough profiling to know exactly which line in here are slow? I don't quite understand the `np.ravel` calls. You might do better either with one (or many?) collection artists. You might also look into just updating the artists you have. Without some context of what these patches are it is really hard to help (or even really understand why this is slow). Tom On Sat, May 16, 2015 at 6:44 PM bmer <bhm...@gm...> wrote: > This is what my animation function (i.e. the one that gets called by > `FuncAnimation`) looks like: > > import numpy as np > ... > def mpl_animation_function(n): > print "animating timestep: ", n > > if n > 0: > previous_relevant_patch_indices = > np.ravel(patch_indices_per_timestep[n-1]) > for index in previous_relevant_patch_indices: > (patches[index]).set_visible(False) > > relevant_patch_indices = > np.ravel(patch_indices_per_timestep[n]) > > for index in relevant_patch_indices: > (patches[index]).set_visible(True) > > return patches, > > `patches` is a pre-generated list of patches (possibly large), that have > already been added to an `axes` instance. > > > This function is awfully time-consuming as the number of patches becomes > large. > > One idea I had was to parallelize the `for` loop, but likely that won't > work > because of issues with the `axes` instance being accessed and modified in > parallel -- so I am afraid of fruitlessly spending time there. Do I have > any > other options, or is parallelization possible? > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/What-are-my-options-for-speeding-up-a-custom-function-called-by-FuncAnimation-tp45562.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: mato <mat...@ya...> - 2015-05-19 22:16:23
|
...or I can put the file(s) that dynamically change the rc settings in the current directory and just execute them (import) whenever I want to use different settings for the plots. This is less elegant than the configuration file, but at least solves my problem for now. Thank you Yuxian. Cheers Mato Yuxiang Wang wrote > Here is what I did: > > Put a 00_matplotlib_rc.py in ipython's profile_default/startup folder > (you might need to run ipython profile create, or ipython profile > locate to create/find them), and in the file specify my matplotlib rc > parameters. For example: > > import matplotlib as mpl > > > # Figure formatting > mpl.rcParams['savefig.dpi'] = 300 > mpl.rcParams['figure.figsize'] = (3.27, 3.27) > > ... -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matplotlibrc-has-no-effect-on-the-plot-windows7-tp45573p45577.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Yuxiang W. <yw...@vi...> - 2015-05-19 21:55:32
|
Here is what I did: Put a 00_matplotlib_rc.py in ipython's profile_default/startup folder (you might need to run ipython profile create, or ipython profile locate to create/find them), and in the file specify my matplotlib rc parameters. For example: import matplotlib as mpl # Figure formatting mpl.rcParams['savefig.dpi'] = 300 mpl.rcParams['figure.figsize'] = (3.27, 3.27) # Font setting mpl.rcParams['mathtext.default'] = 'regular' mpl.rcParams['font.family'] = ['sans-serif'] mpl.rcParams['font.sans-serif'] = ['Arial'] mpl.rcParams['font.size'] = 8 mpl.rcParams['pdf.fonttype'] = 42 mpl.rcParams['ps.fonttype'] = 42 # Line properties mpl.rcParams['lines.linewidth'] = 1. mpl.rcParams['lines.markersize'] = 4 # Legends mpl.rcParams['legend.frameon'] = False mpl.rcParams['legend.fontsize'] = 8 mpl.rcParams['legend.handlelength'] = 3 # Subplot frame line mpl.rcParams['axes.linewidth'] = .5 I would be happy to know if there's a better/different way to do it. Shawn On Tue, May 19, 2015 at 5:49 PM, mato <mat...@ya...> wrote: > This might be the case (I'm running Anaconda/Spyder/Ipython) however so far I > haven't been able to locate the appropriate settings file... > > > Yuxiang Wang wrote >> Are you using IPython QtConsole / Notebook? I think they have their >> own settings on their backend. >> >> Shawn > > > > > > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/matplotlibrc-has-no-effect-on-the-plot-windows7-tp45573p45575.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Yuxiang "Shawn" Wang Gerling Research Lab University of Virginia yw...@vi... +1 (434) 284-0836 https://sites.google.com/a/virginia.edu/yw5aj/ |
From: mato <mat...@ya...> - 2015-05-19 21:49:58
|
This might be the case (I'm running Anaconda/Spyder/Ipython) however so far I haven't been able to locate the appropriate settings file... Yuxiang Wang wrote > Are you using IPython QtConsole / Notebook? I think they have their > own settings on their backend. > > Shawn -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matplotlibrc-has-no-effect-on-the-plot-windows7-tp45573p45575.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Yuxiang W. <yw...@vi...> - 2015-05-19 17:04:28
|
Are you using IPython QtConsole / Notebook? I think they have their own settings on their backend. Shawn On Tue, May 19, 2015 at 11:01 AM, mato <mat...@ya...> wrote: > I want to change the look of the default plots in Python, so I created the > file matplotlibrc in the current working directory (Windows 7). The file > gets loaded: > > /import matplotlib as mp > print('Config. file loaded from:', mp.matplotlib_fname())/ > > prints: > > /Config. file loaded from: > C:\Users\mato\Documents\Python_Scripts\matplotlibrc/ > > however, the plot is unaffected. > > The simple code: > > /import matplotlib.pyplot as plt > x = [1,2,3,4,5] > plt.plot(x)/ > > with the matplotlibrc file that looks like this: > > /lines.linestyle : -- > axes.grid : True/ > > yields the plot with the solid line and no grid in the plot. What am I > missing? > > Note: > If I insert > > /plt.rcParams['axes.grid']=True > plt.rcParams['lines.linestyle']='--' / > > in the code, it works as expected > > > > > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/matplotlibrc-has-no-effect-on-the-plot-windows7-tp45573.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Yuxiang "Shawn" Wang Gerling Research Lab University of Virginia yw...@vi... +1 (434) 284-0836 https://sites.google.com/a/virginia.edu/yw5aj/ |
From: mato <mat...@ya...> - 2015-05-19 15:01:38
|
I want to change the look of the default plots in Python, so I created the file matplotlibrc in the current working directory (Windows 7). The file gets loaded: /import matplotlib as mp print('Config. file loaded from:', mp.matplotlib_fname())/ prints: /Config. file loaded from: C:\Users\mato\Documents\Python_Scripts\matplotlibrc/ however, the plot is unaffected. The simple code: /import matplotlib.pyplot as plt x = [1,2,3,4,5] plt.plot(x)/ with the matplotlibrc file that looks like this: /lines.linestyle : -- axes.grid : True/ yields the plot with the solid line and no grid in the plot. What am I missing? Note: If I insert /plt.rcParams['axes.grid']=True plt.rcParams['lines.linestyle']='--' / in the code, it works as expected -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matplotlibrc-has-no-effect-on-the-plot-windows7-tp45573.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Benjamin R. <ben...@ou...> - 2015-05-18 16:04:56
|
I noticed in your output that another figure seems to have been created (you see its output as "<matplotlib.figure.Figure at 0x1354cb70>"). It would be useful to add some print statements to figure out exactly which line is emitting that. Second, you are calling "plt.savefig()" in the for-loop for the same filename. I suspect that isn't what you want. I am going to assume that you want to save a final figure after the for-loop is complete, right? Also, it would be more clear to use "fig.savefig()" instead of the more "magical" plt.savefig() as the latter would automatically create a figure if one didn't exist for some reason. Ben Root On Sat, May 16, 2015 at 11:57 AM, Thomas Caswell <tca...@gm...> wrote: > This is coming out of the pandas plotting tools, you might get better > answers on their mailing list. > > Tom > > On Sat, May 16, 2015 at 11:51 AM Juan Wu <wuj...@gm...> wrote: > >> Hi, List experts, >> >> I have a matplotlib problem when I tried to use a tool called HDDM. As >> HDDM is another issue, I here just post my problem with Matplotlib. In >> short, the error alarm appeard when I input fig = plt.figure(). I am a >> beginner with those stuff. >> >> I would appreciate if anyone can give me any good pointers. >> >> Thanks so much, >> Juan >> >> ================== >> >> In [8]: fig = plt.figure() >> <matplotlib.figure.Figure at 0x13293890> >> >> In [9]: ax = fig.add_subplot(111, xlabel='RT', ylabel='count', >> title='RT distributions') >> >> In [10]: for i, subj_data in data.groupby('subj_idx'): >> ...: subj_data.rt.hist(bins=20, histtype='step', ax=ax) >> ...: plt.savefig('hddm_demo_fig_00.pdf') >> >> <matplotlib.figure.Figure at 0x1354cb70> >> Traceback (most recent call last): >> >> File "<ipython-input-15-3b0b3c83094c>", line 2, in <module> >> subj_data.rt.hist(bins=20, histtype='step', ax=ax) >> >> File "C:\Anaconda\lib\site-packages\pandas\tools\plotting.py", line >> 2830, in hist_series >> raise AssertionError('passed axis not bound to passed figure') >> >> AssertionError: passed axis not bound to passed figure >> >> (relevant link: >> https://groups.google.com/forum/#!topic/hddm-users/yBeIRJaHGwo >> there very few experts view and reply questions) >> >> >> ------------------------------------------------------------------------------ >> 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 >> Mat...@li... >> 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Thomas C. <tca...@gm...> - 2015-05-18 14:41:00
|
Amy, I expect so (but do not have a system to test on). Continuum builds everything on a very old CentOS system and we run our CI tests on ubuntu 12.04 which is of a similar vintage. The crucial packages are `pkg-config`, `freetype-dev` and `libpng-dev` + what ever gui framework you want. Tom On Mon, May 18, 2015 at 10:24 AM Fort, Amy (Subcontractor) < Amy...@te...> wrote: > *Dear matplotlib-users,* > > > > *I have a general question on matplotlib. I see that matplotlib 1.4.3 > supports Python 2.7 (our organization has 2.7.8). We would like to use > matplotlib as a plot tool. Is matplotlib 1.4.3 compatible to run on a > Linux system with RedHat 5.10?* > > > > *Thank you.* > > > > *Amy Fort* > > > > > > > > > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Fort, A. (Subcontractor) <Amy...@Te...> - 2015-05-18 14:23:41
|
Dear matplotlib-users, I have a general question on matplotlib. I see that matplotlib 1.4.3 supports Python 2.7 (our organization has 2.7.8). We would like to use matplotlib as a plot tool. Is matplotlib 1.4.3 compatible to run on a Linux system with RedHat 5.10? Thank you. Amy Fort |
From: Amit S. <ami...@gm...> - 2015-05-18 12:32:02
|
Got my answer here: http://stackoverflow.com/questions/30301986/matplotlib-imshow-and-pixel-intensity On Sun, May 17, 2015 at 10:02 PM, Amit Saha <ami...@gm...> wrote: > Hi all, > > Just trying to understand how the value of the matrix fed to imshow() > function determines the intensity of the pixel in grey scale mode. > Consider the example code: > > import random > import matplotlib.pyplot as plt > import matplotlib.cm as cm > > def pixels(n=3): > pixel_data = [] > for _ in range(n): > row = [] > for _ in range(n): > row.append(random.randint(1, 10)) > pixel_data.append(row) > return pixel_data > > if __name__ == '__main__': > pixel_data = pixels() > print(pixel_data) > plt.imshow(pixel_data, origin='lower', cmap=cm.Greys_r) > plt.show() > > > The pixel_data here is the 3*3 "matrix": > [[7, 4, 6], [7, 7, 6], [4, 7, 9]] > > How does the values here determine what shade of grey I see in the image? > > Thank you in advance. > > Best, > Amit. > > > -- > http://echorand.me -- http://echorand.me |
From: Amit S. <ami...@gm...> - 2015-05-17 12:03:24
|
Hi all, Just trying to understand how the value of the matrix fed to imshow() function determines the intensity of the pixel in grey scale mode. Consider the example code: import random import matplotlib.pyplot as plt import matplotlib.cm as cm def pixels(n=3): pixel_data = [] for _ in range(n): row = [] for _ in range(n): row.append(random.randint(1, 10)) pixel_data.append(row) return pixel_data if __name__ == '__main__': pixel_data = pixels() print(pixel_data) plt.imshow(pixel_data, origin='lower', cmap=cm.Greys_r) plt.show() The pixel_data here is the 3*3 "matrix": [[7, 4, 6], [7, 7, 6], [4, 7, 9]] How does the values here determine what shade of grey I see in the image? Thank you in advance. Best, Amit. -- http://echorand.me |
From: Eric F. <ef...@ha...> - 2015-05-17 01:35:58
|
On 2015/05/16 3:20 PM, Paul Hobson wrote: > > On Saturday, May 16, 2015 at 14:58, Neil Girdhar <mis...@gm... > <mailto:mis...@gm...>>, wrote: > > Thanks, and if I want to revert my system to its old matplotlib? > > > > Assuming you cloned the repo from git, just checkout any revision you want. But you have to rerun the "pip install -e ." or "setup.py develop" so that the extension code will be rebuilt if there were any extension code changes between revisions. > > If didn't clone from git, just reinstall matplotlib anyway you want. It's not as simple as that, unfortunately, because different installation methods put things in different places. For example, if you are on linux, the package manager will install the /usr tree while setup etc will install in the /usr/local tree. The usual advice for getting around such problems is to use a fresh virtualenv (or conda environment if you are using Anaconda) for your development. Alternatively you can use a user install to a location of your choice and then add that to your PYTHONPATH when you want to work in development mode, and remove it when you want to run with whatever python environment you had before. Eric > > > > > -Paul. > > > > > On Sat, May 16, 2015 at 5:52 PM, Paul Hobson <pmh...@gm... > <mailto:pmh...@gm...>> wrote: > > After you've setup your development environment with all of the > MPL dependencies, navigate to the MPL source directory and > install it with: > > $ python setup.py develop > > or > > $ pip install -e . > > That'll create a link in site-packages (or whatever that > directory is) to the source directory. After you make changes to > the source code, you'll either need to use the "imp" module to > reload MPL and the submodule you changed. I typically find it > easier to just restart my python interpreter. > -Paul > > On Sat, May 16, 2015 at 1:45 PM, Neil Girdhar > <mis...@gm... <mailto:mis...@gm...>> wrote: > > How do I set it up so that I can import my local matplotlib > dev copy? > > I tried making a sym-link to matplotlib/lib/matplotlib, but > it's giving me errors: > > import matplotlib.transforms as mtransforms > AttributeError: 'module' object has no attribute 'transforms' > > Thanks, > > Neil > > ------------------------------------------------------------------------------ > 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-devel mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > > > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |