Re: [Matplotlib-users] colorbar.py bug in matplotlib 1.1.0?
Thanks Tony. This is actually a brand new Python installation. I am running on 64-bit Windows 7, with Enthought's EPD 7.2.2 (also 64-bit). I tried testing various code snippets again and found that when I run my code, subsequent gallery examples (that call colorbar()) fail. When I run the gallery examples first they work as expected, but my code still fails in the same place. Hmmm - Josh Hemann -- View this message in context: http://old.nabble.com/colorbar.py-bug-in-matplotlib-1.1.0--tp33203387p33204535.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] colorbar.py bug in matplotlib 1.1.0?
I have some code that has worked in matplotlib versions 0.99 and 1.0.1. Recently, I updated to 1.1.0 and my code broke, specifically in a call to colorbar(). I tried running http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html this gallery example and get the same error. Here is the snippet: http://old.nabble.com/file/p33203387/ScreenShot007.png The error results from the first call to colorbar in the example, which is cbar = fig.colorbar(cax, ticks=[-1, 0, 1]) My internet searches have not revealed anything yet. Has anyone seen or reported this issue? Any clean work-arounds? - Josh Hemann -- View this message in context: http://old.nabble.com/colorbar.py-bug-in-matplotlib-1.1.0--tp33203387p33203387.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] broken demo
There is an open bug filed on this issue, #608932. Specifically, the issue is that multiple plots in the gallery examples work when run from a Python prompt, yet the html page that gets generated for the documentation shows the exception message. For what it is worth, I submitted the radar chart demo a while back so if there are chart-specific questions I might be able to help. Josh Benjamin Root-2 wrote: > > On Sunday, June 26, 2011, Warren Weckesser > wrote: >> >> >> On Sun, Jun 26, 2011 at 7:44 PM, Benjamin Root wrote: >> >> >> On Sunday, June 26, 2011, Carl Karsten wrote: >>> http://matplotlib.sourceforge.net/examples/api/radar_chart.html >>> >>> "Exception occurred rendering plot." >>> >> >> Without more information, we can't help you. What version of >> matplotlib are you using? On what OS? How did you install it? Do the >> tests pass? And which backend? >> >> >> That error is what shows up on the web page when you follow the link. >> >> Warren >> >> > > Ah, indeed it is. I apologize for misunderstanding, what is odd is > that the demo didn't work, but the mpl logo rendered fine. > > Who was it that uploaded the recent rebuild of the docs? > > Ben Root > > -- > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > - Josh Hemann Group Manager - Advanced Analytics Sports Authority jhemann at sportsauthority com -- View this message in context: http://old.nabble.com/broken-demo-tp31933682p32037581.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Interactive plotting hangs with certain backends on 64-bit Windows 7
When performing interactive plotting from a script (i.e. matplotlib.interactive(True) followed by my plotting code, no show() calls involved but sometimes draw()) I am getting plot windows that initially show a plot, but upon attempts at interaction hang and go blank. Unfortunately, I cannot reproduce this with simple examples yet, only from an application that I have been using for the past year starting with matplotlib 0.98, then 0.99.3, and now 1.0.0. Details... I am on 64-bit Windows 7 using 64-bit Python 2.7 and many 64-bit packages, including matplotlib, from http://www.lfd.uci.edu/~gohlke/pythonlibs/ Chris Gohlke's excellent site . I encounter these hanging, interactive windows in the following Python environments o 64-bit Python 2.6.5 with matplotlib 1.0.0 64-bit installer from source forge o 64-bit Python 2.7 with matplotlib 1.0.0 64-bit installer from Chris' periodic svn builds. This is my main environment. In both environments, the problem exists with the TkAgg and WxAgg backends, and it happens whether I use the basic Python shell, or the IPython 0.10 and 0.11 shells. The solution for me is to use the Qt4Agg backend. Everything works as expected using this backend. I cannot find any obvious issues in my code. Again, this application has been working with previous versions of matplotlib using the default TkAgg backend, on 32-bit Windows XP and 64-bit Windows 7 for a while now. Has anyone else experienced similar issues? There is a http://old.nabble.com/problems-with-ipython-0.10-autocompletion-and-interactive-plotting-td29312351.html#a29421228 related thread here which seems to have been dealt with by reverting to 0.99.3. Thanks, - Josh Hemann Statistical Advisor http://www.roguewave.com//"; Rogue Wave Software jhemann at vni dizzot com -- View this message in context: http://old.nabble.com/Interactive-plotting-hangs-with-certain-backends-on-64-bit-Windows-7-tp29822071p29822071.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to overlay an image on a multi plot? (Edit: how to plot sparklines on an existing plot)
OK, I am finally posting some code. The graphic it will produce is similar to above. I mocked up some time series data and fit one of the regression lines using PyIMSL Studio (Scipy for the other one). Full disclosure: I am on the PyIMSL Studio team at Rogue Wave Software. You can use PyIMSL Studio for free for noncommercial use, and you can choose to install just the math/stat/data libraries under site-packages like any other Python package. But, as for the matplotlib calls themselves, hopefully the code is clear and a useful example. Cheers. http://old.nabble.com/file/p28272259/matplotlib_gallery_scatter.py matplotlib_gallery_scatter.py - Josh Hemann Statistical Advisor http://www.roguewave.com//"; Rogue Wave Software jhemann at vni dizzot com -- View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28272259.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to overlay an image on a multi plot? (Edit: how to plot sparklines on an existing plot)
AlanIsaac wrote: > > Nice. > You might want to see > http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR > if you have not already. > > Alan Isaac > Thanks again Alan. I know I am abusing the term "sparkline" because I am not embedding the visualization within text, but I am not sure what else to call it. I do think that showing the time series not bound within a set of axes, without labels, underscores that the time series is a "quick hit", just like the histograms are. The main focus should be on the scatter plot, with the marginal visualizations there to aid in quick assessment of distribution and behavior over time. For true sparklines, here is http://bitworking.org/news/Sparklines_in_data_URIs_in_Python another nice example in Python . - Josh Hemann Statistical Advisor http://www.vni.com/ Visual Numerics jhemann at vni dizzot com -- View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28147118.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to overlay an image on a multi plot? (Edit: how to plot sparklines on an existing plot)
OK, I am in business. I read through the code that Alan linked to which helped me understand what to do, which does not involve overlaying any images. So, this thread is a dead end with respect to the original question. Here is the new graphic. http://old.nabble.com/file/p28144782/Full5%252B8%252B2_vs_Bulk1%252B2.png In a publication I think I would need to mention the date range for the sparklines. I like this, it is visually dense (marginal time series behavior, marginal density, and relationship between two variables) but does not seem cluttered. I'll post code tonight... - Josh Hemann Statistical Advisor http://www.vni.com/ Visual Numerics jhemann at vni dizzot com -- View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28144782.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to overlay an image on a multi plot?
Alan, Thanks much for that link. I started playing with this code and after some hacking I might get what I need. If I cobble this together successfully I'll post the results and the code. Josh - Josh Hemann Statistical Advisor http://www.vni.com/ Visual Numerics jhemann at vni dizzot com -- View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28143553.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] How to overlay an image on a multi plot?
Hi All, I used the http://matplotlib.sourceforge.net/examples/pylab_examples/scatter_hist.html scatter_hist example from the Gallery to create the following visualization: http://old.nabble.com/file/p28111498/Full5%252B8%252B2_vs_Bulk1%252B2.png What I would like to do is overlay some http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR sparklines so in one visualization I can see - The correlation between two variables - The marginal densities of the variables - A quick idea of what the variables did in time I found some Python code for generating sparklines at M http://www.perrygeo.net/wordpress/?p=64 atthew Perry's blog . The code works great for my purposes, and the sparklines are dumped out as PNG files, like this one http://old.nabble.com/file/p28111498/spark_x.png But, all of the examples and forum discussions I can find pertain to using an image as the background for a set of axes, and then plotting or contouring over the image. I simply want to overlay a PNG on an existing set of multiple axes. I know I can use something like Adobe Illustrator to do this outside of matplotlib, but is there a way to do this programmatically? Thanks! - Josh Hemann Statistical Advisor http://www.vni.com/ Visual Numerics jhemann at vni dizzot com -- View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28111498.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Is there a maximum number of x tickmarks?
Gökhan SEVER-2 wrote: > > Oh these busy chemical compound plots :) Are those results of gas > chromatography analysis? > > Something like below produces a nice fully plotted output here. Could you > give it a try? > > import matplotlib.pyplot as plt > plt.plot(range(100)) > locs, labels = plt.xticks(range(100), range(100)) > plt.setp(labels, rotation=90, fontsize=7) > plt.show() > > > -- > Gökhan > Gokhan, Your suggestion works great. I guess the MaxNLocator approach I have been using will place __up__to__ N ticks but not necessarily N ticks? And yes, these chemical profiles are from GCMS and other devices/techniques. I added upper X axis tick labels so you know a given chemical species' name and number; I chose to only have one legend to keep the clutter down as much as possible; I position the upper X axis labels in or outside the plot depending on whether the plot title exists. Luckily, I don't imagine having to deal with more species than 105 any time soon. Thanks again! Here is the improved plot (sorry for the pink background, I am not sure why it is showing up that way): http://old.nabble.com/file/p27927991/PMF2BasecaseProfiles.jpeg - Josh Hemann Statistical Advisor http://www.vni.com/ Visual Numerics jhemann at vni dizzot com -- View this message in context: http://old.nabble.com/Is-there-a-maximum-number-of-x-tickmarks--tp27924845p27927991.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Is there a maximum number of x tickmarks?
I have an issue with showing more than 81 tick marks on an X axis and I am trying to determine a way around it. Background... I am plotting vectors in which each element represents a different variable and I really do want to see the labels associated with each element. The vectors may be only 8 elements long, or as much as 110. When there are more than say 40 elements, I usually split the plot into two plots contained in a single figure window (e.g., plotting elements 0:30 in fig.add_subplot(211) and 30:60 in fig.add_subplot(212)). Here are a couple of examples... Only 41 variables: http://old.nabble.com/file/p27924845/Factor_2_TrainingProfiles.png 71 variables: http://old.nabble.com/file/p27924845/Factor_2_TrainingProfiles.jpeg I have a vector with a 105 elements and before I split things into three plots I wanted to see what cramming 53 or so variables into a single set of axes would look like. But, my code that works for these cases does not show enough tickmarks for the 105 element data. Here is an example that you can copy and paste to see for yourself. import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator fig = plt.figure(figsize=[12,7]) ax = fig.add_subplot(111) ax.plot(range(110)) fig.canvas.draw() ints = range(1,111) ints = [str(num) for num in ints] ax.xaxis.set_major_locator(MaxNLocator(110)) xtickNames = plt.setp(ax, xticklabels=ints) plt.setp(xtickNames, rotation=90, fontsize=7); If you play with the argument to MaxNLocator, you'll see how for smaller values (like 40) things work as expected (or at least how I have shown the code has worked for the smaller data sets). I have been poking around trying to see what options I have and have not found anything to get past this limit. Before I start diving into source code, can anyone suggest -Is there a limit? -Is there an obvious way to accomplish what I need? Ultimately, I may split large vectors like this into more than two plots but hitting that limit has made me want to investigate why. Thanks! - Josh Hemann Statistical Advisor http://www.vni.com/ Visual Numerics jhem...@vni.com | P 720.407.4214 | F 720.407.4199 -- View this message in context: http://old.nabble.com/Is-there-a-maximum-number-of-x-tickmarks--tp27924845p27924845.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Hiding data via legend
For this particular data set you might try simply using a log-scaled Y-axis. As to the larger question of interactively adding/removing plot elements, take a look at Enthought's Chaco toolkit. I think most people would agree that its plotting features are not as rich as mpl, but with respect to customizing interaction with graphical elements, it seems like the best path out there. See http://code.enthought.com/projects/chaco/docs/html/user_manual/faq.html Josh Gökhan SEVER-2 wrote: > > Hello, > > I was wondering if it is possible to hide some data on figures using a say > right click option to any of the legend entry and make it temporarily > hidden/visible to better analyse the rest of the data? > > Check this screenshot for example: > > http://img25.imageshack.us/img25/9427/datahiding.png > > The red data clutters the rest of the figure, and I would like to be able > to > hide it temporarily so that I can investigate the other two relations more > easily. > > Any ideas? or alternative solutions? > > Thanks. > > -- > Gökhan > - Josh Hemann Statistical Advisor http://www.vni.com/ Visual Numerics jhem...@vni.com | P 720.407.4214 | F 720.407.4199 -- View this message in context: http://www.nabble.com/Hiding-data-via-legend-tp24802219p24811505.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] A couple of new gallery examples?
xloc = 0.98*width #Shift the text to the left side of the right edge clr = 'white' #White on magenta align = 'right' yloc = rect.get_y()+rect.get_height()/2.0 #Center the text vertically in the #bar ax1.text(xloc, yloc, rankStr, horizontalalignment=align, verticalalignment='center', color=clr, weight='bold') plt.show() - boxplotdemo.py - import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Polygon #Generate some data from five different probability distributions, each with #different characteristics. We want to play with how an IID bootstrap resample #of the data preserves the distributional properties of the original sample, and #a boxplot is one visual tool to make this assessment numDists = 5 randomDists = ['Normal(1,1)',' Lognormal(1,1)', 'Exp(1)', 'Gumbel(6,4)', 'Triangular(2,9,11)'] N = 500 norm = np.random.normal(1,1, N) logn = np.random.lognormal(1,1, N) expo = np.random.exponential(1, N) gumb = np.random.gumbel(6, 4, N) tria = np.random.triangular(2, 9, 11, N) #Generate some random indices that we'll use to resample the original data #arrays. For code brevity, just use the same random indices for each array bootstrapIndices = np.random.random_integers(0, N-1, N) normBoot = norm[bootstrapIndices] expoBoot = expo[bootstrapIndices] gumbBoot = gumb[bootstrapIndices] lognBoot = logn[bootstrapIndices] triaBoot = tria[bootstrapIndices] data = [norm, normBoot, logn, lognBoot, expo, expoBoot, gumb, gumbBoot, tria, triaBoot] fig = plt.figure(figsize=(10,6)) fig.canvas.set_window_title('A Boxplot Example') ax1 = fig.add_subplot(111) plt.subplots_adjust(left=0.075, right=0.95, top=0.9, bottom=0.25) bp = plt.boxplot(data, notch=0, sym='+', vert=1, whis=1.5) plt.setp(bp['boxes'], color='black') plt.setp(bp['whiskers'], color='black') plt.setp(bp['fliers'], color='red', marker='+') #Add a horizontal grid to the plot, but make it very light in color so we can #use it for reading data values but not be distracting ax1.yaxis.grid(True, linestyle='-', which='major', color='lightgrey', alpha=0.5) #Hide these grid behind plot objects ax1.set_axisbelow(True) ax1.set_title('Comparison of IID Bootstrap Resampling Across Five Distributions') ax1.set_xlabel('Distribution') ax1.set_ylabel('Value') #Now fill the boxes with desired colors boxColors = ['darkkhaki','royalblue'] numBoxes = numDists*2 medians = range(numBoxes) for i in range(numBoxes): box = bp['boxes'][i] boxX = [] boxY = [] for j in range(5): boxX.append(box.get_xdata()[j]) boxY.append(box.get_ydata()[j]) boxCoords = zip(boxX,boxY) #Alternate between Dark Khaki and Royal Blue k = i % 2 boxPolygon = Polygon(boxCoords, facecolor=boxColors[k]) ax1.add_patch(boxPolygon) #Now draw the median lines back over what we just filled in med = bp['medians'][i] medianX = [] medianY = [] for j in range(2): medianX.append(med.get_xdata()[j]) medianY.append(med.get_ydata()[j]) plt.plot(medianX, medianY, 'k') medians[i] = medianY[0] #Finally, overplot the sample averages, with horixzontal alignment in the #center of each box plt.plot([np.average(med.get_xdata().data)], [np.average(data[i])], color='w', marker='*', markeredgecolor='k') #Set the axes ranges and axes labels ax1.set_xlim(0.5, numBoxes+0.5) top = 40 bottom = -5 ax1.set_ylim(bottom, top) xtickNames = plt.setp(ax1, xticklabels=np.repeat(randomDists, 2)) plt.setp(xtickNames, rotation=45, fontsize=8) #Due to the Y-axis scale being different across samples, it can be hard to #compare differences in medians across the samples. Add upper X-axis tick labels #with the sample medians to aid in comparison (just use two decimal places of #precision) pos = np.arange(numBoxes)+1 upperLabels = [str(np.round(s, 2)) for s in medians] weights = ['bold', 'semibold'] for tick,label in zip(range(numBoxes),ax1.get_xticklabels()): k = tick % 2 ax1.text(pos[tick], top-(top*0.05), upperLabels[tick], horizontalalignment='center', size='x-small', weight=weights[k], color=boxColors[k]) #Finally, add a basic legend plt.figtext(0.80, 0.08, str(N) + ' Random Numbers' , backgroundcolor=boxColors[0], color='black', weight='roman', size='x-small') plt.figtext(0.80, 0.045, 'IID Bootstrap Resample', backgroundcolor=boxColors[1],
Re: [Matplotlib-users] Radar / Spider Chars
weight='roman', size='x-small') plt.figtext(0.80, 0.045, 'IID Bootstrap Resample', backgroundcolor=boxColors[1], color='white', weight='roman', size='x-small') plt.figtext(0.80, 0.015, '*', color='white', backgroundcolor='silver', weight='roman', size='medium') plt.figtext(0.815, 0.013, ' Average Value', color='black', weight='roman', size='x-small') plt.show() - Josh Hemann Statistical Advisor http://www.vni.com/ Visual Numerics jhem...@vni.com | P 720.407.4214 | F 720.407.4199 -- View this message in context: http://www.nabble.com/Radar---Spider-Chars-tp17876254p24764036.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Sourceforge download page shows basemap as default download on windows
I downloaded it also yesterday thinking I was getting a newer (than 0.98.5.3) version of matplotlib. Definitely misleading, so thanks for posting this thread. Josh Kaushik Ghose-3 wrote: > > Hi All, > > I was downloading matplotlib on a windows machine and the sourceforge site > (http://sourceforge.net/projects/matplotlib/) showed me basemap as the > default > download (instead of the latest matplotlib). On Mac the default download > shows > correctly as matplotlib. > > This is some autodetection from sourceforge, so I don't know if it is a > sitewide > problem, or it can be configured from the project page. Just to let the > admins know. > > Best > -Kaushik > > -- > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/Sourceforge-download-page-shows-basemap-as-default-download-on-windows-tp24711475p24722906.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Radar / Spider Chars
Fernando Perez wrote: > > On Tue, Jul 28, 2009 at 11:26 AM, Josh Hemann wrote: >> FYI I have some other examples I was thinking would be useful. Here is an >> enhanced boxplot example >> that might compliment the simple examples well: >> >> http://www.nabble.com/file/p24705282/boxplotExample.png > > Please! That example with the top labels looks great, and it's a very > useful way of displaying the numerical key parts of the dataset. > > Cheers, > > f > Great! I'll get started on extracting the plotting code from a larger application I have, and I'll do my best to clean it up. Unless I hear otherwise, I'll just post the code in this thread and let you guys run with it if you want to. Josh -- View this message in context: http://www.nabble.com/Radar---Spider-Chars-tp17876254p24707753.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Radar / Spider Chars
Tony, This looks great, and I am enjoying seeing how to accomplish things in a more Pythonic way. I don't see the radial grid lines, but I am using 0.98.5.3. I am downloading 0.99.3 now and maybe that will be the fix (I have yet to figure out how to build out of svn on Windows...). One small nit: I don't see any code to set the color or alpha level of the grid lines. In my example, I set the color to be a light grey because I wanted the grid lines to be seen but not be distracting from the data. Just a preference. Cheers, Josh > Josh Hemann wrote: >> Tony, >> >> I know this is a year later but your code was hugely helpful to me >> last >> week, so thank you I'm glad you found it helpful. On Jul 28, 2009, at 12:56 PM, Michael Droettboom wrote: > Would you (Josh and Tony) be amenable to us including this in the > set of > examples? It would make it easier for users to find it. > Eventually, it > might be nice to include this as a core plotting command, but in the > meantime, I think it would still be useful as-is. > > Mike Hey Mike, I'm always happy to contribute what little I can to matplotlib. However, if it's going to be an official example, it should be cleaned up a bit (see attached). Summary of changes. * My original example (i.e. not Josh's fault) didn't play well with namespaces (i.e. from pylab import *). This has been changed to use the proper imports (i.e. np and plt). * Also, there were problems with rgrids when I originally wrote the code, which has since been fixed (at least on trunk it is). This eliminates the need to manually draw a grid. * I made a few other clean ups for clarity. (Josh: I hope you don't mind, I switched the data for f4_base and f5_base so that I could remove the associated comment.) * Final note. The polygon frame no longer works properly and I couldn't really figure out how to fix it. Best, -Tony <\quote> -- View this message in context: http://www.nabble.com/Radar---Spider-Chars-tp17876254p24707635.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Radar / Spider Chars
Michael Droettboom-3 wrote: > > Would you (Josh and Tony) be amenable to us including this in the set of > examples? It would make it easier for users to find it. Eventually, it > might be nice to include this as a core plotting command, but in the > meantime, I think it would still be useful as-is. > > Mike > Mike, I would be all for including it as an example, and agree that it would be nice to see this routine made more robust for inclusion into matplotlib. I'd volunteer, but I am still on the steep part of the learning curve. Maybe in coming months... FYI I have some other examples I was thinking would be useful. Here is an enhanced boxplot example that might compliment the simple examples well: http://www.nabble.com/file/p24705282/boxplotExample.png Its based on the same data as in the radar charts, just a different visualization (a more detailed, side by side comparison between the with-and-without-carbon-monoxide solution variability across hundreds of simulations). The upper x-axis labels are the box medians, so you can scan these labels for a faster gleaning of the actual numbers. Cheers, Josh -- View this message in context: http://www.nabble.com/Radar---Spider-Chars-tp17876254p24705282.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Radar / Spider Chars
Tony, I know this is a year later but your code was hugely helpful to me last week, so thank you. I needed to make a few modifications to get exactly what I needed, so I thought I'd add to the post for posterity... First, here is the graphic that the sample code generates (>> execfile('radarPlotExample.py'): http://www.nabble.com/file/p24688050/profileComparisonPub.png profileComparisonPub.png Suffice it to say, I think this looks way better than what you get out of R or MATLAB (e.g. http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=123). Here is the code. I have tried to add comments in places that differ from Tony's code. I am a relatively new Python and matplotlib convert, so please feel free to comment on better ways to do this. But, like Tony said, hopefully this will help someone. Josh --- radarPlotExample.py --- from matplotlib.projections.polar import PolarAxes from matplotlib.projections import register_projection from pylab import * def radar_factory(num_vars, frame='polygon'): """Create a radar chart with `num_vars` axes. """ # calculate evenly-spaced axis angles theta = 2*pi * linspace(0, 1-1/float(num_vars), num_vars) #print theta #print # rotate theta such that the first axis is at the top theta += pi/2 def draw_poly_frame(self, x0, y0, r): # TODO: should use transforms to convert (x, y) to (r, theta) verts = [(r*cos(t) + x0, r*sin(t) + y0) for t in theta] return Polygon(verts, closed=True) def draw_circle_frame(self, x0, y0, r): return Circle((x0, y0), r) frame_dict = {'polygon': draw_poly_frame, 'circle': draw_circle_frame} if frame not in frame_dict: raise ValueError, 'unknown value for `frame`: %s' % frame class RadarAxes(PolarAxes): """Class for creating a radar chart (a.k.a. a spider or star chart) http://en.wikipedia.org/wiki/Radar_chart """ name = 'radar' # use 1 line segment to connect specified points RESOLUTION = 1 # define draw_frame method draw_frame = frame_dict[frame] def fill(self, *args, **kwargs): """Override fill so that line is closed by default""" closed = kwargs.pop('closed', True) return super(RadarAxes, self).fill(closed=closed, *args, **kwargs) def plot(self, *args, **kwargs): """Override plot so that line is closed by default""" lines = super(RadarAxes, self).plot(*args, **kwargs) for line in lines: self._close_line(line) def _close_line(self, line): x, y = line.get_data() # FIXME: markers at x[0], y[0] get doubled-up if x[0] != x[-1]: x = concatenate((x, [x[0]])) y = concatenate((y, [y[0]])) line.set_data(x, y) def set_varlabels(self, labels, rvals, rlabels): self.set_thetagrids(theta * 180/pi, labels) #Josh says: The rvals and rlabels parameters were added to support #the call to the set_rgrid method so you can control the position #and labelling of the circular grid lines. Make the radii labels #smaller than the default size... self.set_rgrids(rvals, labels=rlabels, size='small') def get_axes_patch(self): x0, y0 = (0.5, 0.5) r = 0.5 return self.draw_frame(x0, y0, r) register_projection(RadarAxes) return theta if __name__ == '__main__': #The following data is from the Denver Aerosol Sources and Health study. #See doi:10.1016/j.atmosenv.2008.12.017 # #The data are pollution source profile estimates for five modeled pollution #sources (e.g., cars, wood-burning, etc) that emit 7-9 chemical species. #The radar charts are experimented with here to see if we can nicely #visualize how the modeled source profiles change across four scenarios: # 1) No gas-phase species present, just seven particulate counts on # Sulfate # Nitrate # Elemental Carbon (EC) # Organic Carbon fraction 1 (OC) # Organic Carbon fraction 2 (OC2) # Organic Carbon fraction 3 (OC3) # Pyrolized Organic Carbon (OP) # 2)Inclusion of gas-phase specie carbon monoxide (CO) # 3)Inclusion of gas-phase specie ozone (O3). # 4)Inclusion of both gas-phase speciesis present... N = 9 theta = radar_factory(N) f1_base = [0.88, 0.01, 0.03, 0.03, 0.00, 0.06, 0.01, 0.00, 0.00] f1_CO = [0.88, 0.02, 0.02, 0.02, 0.00, 0.05, 0.00, 0.05, 0.00] f1_O3 = [0.89, 0.
Re: [Matplotlib-users] One more question regarding to boxplotting
Thanks for sending the data and code. After playing around some I still don't have a confident guess as to the problem (or solution), but here is what I would look at more... I issued plot(d[i][8:]) for i 0,1,...11 and looked at the shape of the lines. For the two problem boxes, the plots of the associated data have steep jumps between the 5th and 25th percentiles, when compared with the data associated with the "good" boxes. So, what you have calculated as the 5th and 25th percentiles are not necessarily calculated by boxplot as such because boxplot does not know that you are handing it percentiles of your underlying data: boxplot actually computes the percentiles assuming that the input _is_ the raw data. I would guess that if you gave boxplot the raw data you would not see this issue of missing whiskers. -- View this message in context: http://www.nabble.com/One-more-question-regarding-to-boxplotting-tp23508395p23526653.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] One more question regarding to boxplotting
Gökhan SEVER-2 wrote: > > For some reason on boxplot 3 and 5 on the figure I get fliers instead of > whiskers on the lower parts. > When I look closely at your graphic it looks to me like the lower whiskers are in fact being plotted, but just (essentially) overlayed on lower quartile part of the interquartile box. What do you see if you only plot d[2][8:] with no other boxes? Perhaps showing only one of the problem boxes will allow the Y axis resolution to be such that you can see this effect easier... -- View this message in context: http://www.nabble.com/One-more-question-regarding-to-boxplotting-tp23508395p23514606.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] spie charts in matplotlib?
Brian Granger-2 wrote: > > Wow, it is really striking how much better the matplotlib version of > this plot is compared to R. Very nice! > > Brian > Brian, yes, I agree! John Hunter-4 wrote: > > Sorry forgot to answer your second question. You can create multiple > columns and rows of subplots using the subplot command. Here is an > example: > > > http://matplotlib.sourceforge.net/examples/pylab_examples/line_styles.html > > and here is the subplot tutorial > > > http://matplotlib.sourceforge.net/users/pyplot_tutorial.html#working-with-multiple-figures-and-axes > > When working with lots-o-subplots, you may want to adjust the spacing > between them as well as around the edges with "subplots_adjust" > > > http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure. > subplots_adjust > > There is also a pyplot command by the same name. > > JDH > John, thanks for the helpful links. Thinking about my data more and what I am trying to visualize I now think that the spie charts are not appropriate, as they are intended for merging two pie charts based on the same underlying context (e.g. expected proportions vs actual proportions). That being said, I think the polar bar chart example you sent plus the example of how to have a gridded layout of plots will get me what I need. I realize these examples were right there in the gallery, but it helps to have people suggest things sometimes, so thanks again for responding as you did and not (the seemingly typical forum) "RTFM". If what I come up with is different/interesting enough I'll work on submitting it as an example to the matplotlib gallery. Josh -- View this message in context: http://www.nabble.com/spie-charts-in-matplotlib--tp22856064p22868864.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users