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: Thomas C. <tca...@gm...> - 2015-07-15 14:58:34
|
The PR to fix this is still open ( https://github.com/matplotlib/matplotlib/pull/4202). Tom On Wed, Jul 15, 2015 at 10:29 AM John Coppens <jo...@jc...> wrote: > Hello again, > > I've posted these two issues in separate mails, as I suspect they're > actually different problems. > > This error is particular to the default version of MacOSX's matplotlib > version 1.4.3: > > When doing a simple plot: > > import matplotlib.pyplot as plt > > def test_plot(): > x = range(11) > y = [x0**2 for x0 in x] > > plt.plot(x, y, 'o:', fillstyle='none', label = "1", ms = 10) > plt.legend() > plt.show() > > def main(args): > test_plot() > return 0 > > if __name__ == '__main__': > import sys > sys.exit(main(sys.argv)) > > Much of the data is available on this thread on stackoverflow: > > > http://stackoverflow.com/questions/31408928/how-can-i-plot-hollowed-symbols-connected-with-dotted-lines-in-one-go/31410105?noredirect=1#comment50794519_31410105 > > The gist is that a dotted line ('o:') works correctly > on my system (Linux Slackware/matplotlib 1.3.1 and 1.4.3), on C.C.Yang's > Linux Mint, but not on his MacOSX (on which the _circle symbols_ are also > dotted). > > It does work if he defines TkAgg or GtkAgg (even though he does not have > Gtk installed on his Mac) > > Any suggestions to solve this? > > Is there a problem in the MacOSXAgg backend? > > John > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Benjamin R. <ben...@ou...> - 2015-07-15 14:37:35
|
We have been recently fixing a bunch of issues in the macosx backend (which is default on Macs). Having the circle be dotted sounds exactly like the sort of problem that would be caused by some of the bugs we are addressing. I think we have some of the fixes committed to the master branch, so if you could build and install from git, you can see if the problem is fixed yet or not. Ben Root On Wed, Jul 15, 2015 at 10:29 AM, John Coppens <jo...@jc...> wrote: > Hello again, > > I've posted these two issues in separate mails, as I suspect they're > actually different problems. > > This error is particular to the default version of MacOSX's matplotlib > version 1.4.3: > > When doing a simple plot: > > import matplotlib.pyplot as plt > > def test_plot(): > x = range(11) > y = [x0**2 for x0 in x] > > plt.plot(x, y, 'o:', fillstyle='none', label = "1", ms = 10) > plt.legend() > plt.show() > > def main(args): > test_plot() > return 0 > > if __name__ == '__main__': > import sys > sys.exit(main(sys.argv)) > > Much of the data is available on this thread on stackoverflow: > > > http://stackoverflow.com/questions/31408928/how-can-i-plot-hollowed-symbols-connected-with-dotted-lines-in-one-go/31410105?noredirect=1#comment50794519_31410105 > > The gist is that a dotted line ('o:') works correctly > on my system (Linux Slackware/matplotlib 1.3.1 and 1.4.3), on C.C.Yang's > Linux Mint, but not on his MacOSX (on which the _circle symbols_ are also > dotted). > > It does work if he defines TkAgg or GtkAgg (even though he does not have > Gtk installed on his Mac) > > Any suggestions to solve this? > > Is there a problem in the MacOSXAgg backend? > > John > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Thomas C. <tca...@gm...> - 2015-07-15 14:37:10
|
The Agg backend is a non-gui backend, it just saves to file. The `TkAgg` and `GtkAgg` are gui backends (which are more of front ends, but I digress) which show the output of Agg in a gui window (and provide a layer for handling user interaction). I suspect that how ever your 1.3.1 was installed the system level matplotlibrc file was modified to set the default backend to be one of the GUI backends. See http://matplotlib.org/users/customizing.html#the-matplotlibrc-file You want to set the 'backend' parameter. Tom On Wed, Jul 15, 2015 at 10:22 AM John Coppens <jo...@jc...> wrote: > Hello all. > > I had MatPlotLib 1.3.1 installed, and decided to upgrade to 1.4.3. I > compiled the > .tar.gz package, which went without a hitch (except for a number of > warnings > from gcc). Installation also completed without problems. > > But, on running the same simple plot I was working on, no plot was output: > > import matplotlib.pyplot as plt > > def test_plot(): > x = range(11) > y = [x0**2 for x0 in x] > > plt.plot(x, y, 'o:', fillstyle='none', label = "1", ms = 10) > plt.legend() > plt.show() > > def main(args): > test_plot() > return 0 > > if __name__ == '__main__': > import sys > sys.exit(main(sys.argv)) > > which was somewhat annoying, as I was trying to help out someone on > Stackoverflow. Only after experimenting somewhat, I found that > setting the Agg to GtkAgg, the plot started working again: > > import matplotlib > matplotlib.use('GtkAgg') > > Is this normal? I'm not actually using gtk in this project. > TkAgg also works. > > John > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Benjamin R. <ben...@ou...> - 2015-07-15 14:34:06
|
If your backend is set to Agg, then no interactive window will appear upon call to show(). Agg is intended for headless servers. What might be happening is that somewhere, you have Agg set as the default backend. Ben Root On Wed, Jul 15, 2015 at 10:16 AM, John Coppens <jo...@jc...> wrote: > Hello all. > > I had MatPlotLib 1.3.1 installed, and decided to upgrade to 1.4.3. I > compiled the > .tar.gz package, which went without a hitch (except for a number of > warnings > from gcc). Installation also completed without problems. > > But, on running the same simple plot I was working on, no plot was output: > > import matplotlib.pyplot as plt > > def test_plot(): > x = range(11) > y = [x0**2 for x0 in x] > > plt.plot(x, y, 'o:', fillstyle='none', label = "1", ms = 10) > plt.legend() > plt.show() > > def main(args): > test_plot() > return 0 > > if __name__ == '__main__': > import sys > sys.exit(main(sys.argv)) > > which was somewhat annoying, as I was trying to help out someone on > Stackoverflow. Only after experimenting somewhat, I found that > setting the Agg to GtkAgg, the plot started working again: > > import matplotlib > matplotlib.use('GtkAgg') > > Is this normal? I'm not actually using gtk in this project. > TkAgg also works. > > John > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: John C. <jo...@jc...> - 2015-07-15 14:29:19
|
Hello again, I've posted these two issues in separate mails, as I suspect they're actually different problems. This error is particular to the default version of MacOSX's matplotlib version 1.4.3: When doing a simple plot: import matplotlib.pyplot as plt def test_plot(): x = range(11) y = [x0**2 for x0 in x] plt.plot(x, y, 'o:', fillstyle='none', label = "1", ms = 10) plt.legend() plt.show() def main(args): test_plot() return 0 if __name__ == '__main__': import sys sys.exit(main(sys.argv)) Much of the data is available on this thread on stackoverflow: http://stackoverflow.com/questions/31408928/how-can-i-plot-hollowed-symbols-connected-with-dotted-lines-in-one-go/31410105?noredirect=1#comment50794519_31410105 The gist is that a dotted line ('o:') works correctly on my system (Linux Slackware/matplotlib 1.3.1 and 1.4.3), on C.C.Yang's Linux Mint, but not on his MacOSX (on which the _circle symbols_ are also dotted). It does work if he defines TkAgg or GtkAgg (even though he does not have Gtk installed on his Mac) Any suggestions to solve this? Is there a problem in the MacOSXAgg backend? John |
From: John C. <jo...@jc...> - 2015-07-15 14:21:36
|
Hello all. I had MatPlotLib 1.3.1 installed, and decided to upgrade to 1.4.3. I compiled the .tar.gz package, which went without a hitch (except for a number of warnings from gcc). Installation also completed without problems. But, on running the same simple plot I was working on, no plot was output: import matplotlib.pyplot as plt def test_plot(): x = range(11) y = [x0**2 for x0 in x] plt.plot(x, y, 'o:', fillstyle='none', label = "1", ms = 10) plt.legend() plt.show() def main(args): test_plot() return 0 if __name__ == '__main__': import sys sys.exit(main(sys.argv)) which was somewhat annoying, as I was trying to help out someone on Stackoverflow. Only after experimenting somewhat, I found that setting the Agg to GtkAgg, the plot started working again: import matplotlib matplotlib.use('GtkAgg') Is this normal? I'm not actually using gtk in this project. TkAgg also works. John |
From: vijai <vi...@vi...> - 2015-07-14 08:09:29
|
I cleared the texcache in $HOME/.cache/matplotlib/texcache and everything seems to be back on track. So no need to go over this guys. The issue has been resolved -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Have-issues-with-tex-rendering-tp45899p45929.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Philipp A. <fly...@we...> - 2015-07-13 08:54:59
|
Thomas Caswell <tca...@gm...> schrieb am So., 12. Juli 2015 um 18:21 Uhr: > The new default color map will be 'viridis' (aka option D). > hi, how did you get to that decision? from at cursory glance at the opinions thread there didn’t seem to be a majority for option D as opposed to A, B, and C. A, B, and C were variations on a theme, so a fair vote would be ABC or D, and then if applicable a second one to decide which variation of ABC to use. best, philipp |
From: Pierre H. <pie...@cr...> - 2015-07-12 19:58:25
|
Le 12/07/2015 18:11, Thomas Caswell a écrit : > I recommend everyone watch Nathaniel Smith and Stéfan van der Walt's > talk from SciPy2015 introducing the new color map and providing an > introduction to the math of color > perception: https://www.youtube.com/watch?v=xAoljeRJ3lU Great presentation, thanks for sharing ! -- Pierre |
From: Thomas C. <tca...@gm...> - 2015-07-12 16:11:50
|
Hello all, Following much discussion, we are changing the default color map and styles in the upcoming 2.0 release! The new default color map will be 'viridis' (aka option D). I recommend everyone watch Nathaniel Smith and Stéfan van der Walt's talk from SciPy2015 introducing the new color map and providing an introduction to the math of color perception: https://www.youtube.com/watch?v=xAoljeRJ3lU We are soliciting proposals to change any and all other visual defaults (including adding new rcParams as needed). If you have a proposal please create a PR or issue with the changes to `rcsetup.py` and `matplotlibrc.template` implementing the changes by August 9, 2015 (1 month from now). Do not worry about updating any failing tests. At the end, Micheal Droettboom and I will decide on the new defaults. A 'classic' style will be provided so reverting to the current default values will be a single line of python (`mpl.style.use('classic')`). Please distribute this as widely as possible. We only want to do this once and want to get feedback from as many users as possible. Thomas Caswell PS jet is harmful to you and those around you See https://github.com/matplotlib/matplotlib/pull/4622 for an example proposal PR. |
From: Duncan M. <dun...@gm...> - 2015-07-10 21:38:44
|
Hey all, I wanted to let folks know that there is a new matplotlib book available, having just been published: * https://www.packtpub.com/big-data-and-business-intelligence/mastering-matplotlib The IPython notebooks are listed here (with links to NBViewer as well as the individual chapter repos): * https://github.com/masteringmatplotlib/notebooks The book didn't ship with an Acknowledgements section, so I am attempting to make up for that here: * http://oubiwann.blogspot.com/2015/07/mastering-matplotlib-acknowledgments.html The ToC for the book hasn't been updated on the publisher's (or Amazon's) site, so for your reading pleasure I have included the text from the section "What this book covers" below: Chapter 1, Getting Up to Speed, covers some history and background of matplotlib, goes over some of the latest features of the library, provides a refresher on Python 3 and IPython Notebooks, and whets the reader's appetite with some advanced plotting examples. Chapter 2, matplotlib Architecture, reviews the original design goals of matplotlib and then proceeds to discuss its current architecture in detail, providing visualizations of the conceptual structure and relationships between the Python modules. Chapter 3, matplotlib APIs and Integrations, walks the reader through the matplotlib APIs adapting a single example accordingly, examines how the third-party libraries are integrated with matplotlib, and gives migration advice to the advanced users of the deprecated pylab API. Chapter 4, Event Handling and Interactive Plots, provides a review of the event-based systems, covers event loops in matplotlib and IPython, goes over a selection of matplotlib events, and shows how to take advantage of these to create interactive plots. Chapter 5, High-level Plotting and Data Analysis, combines the interrelated topics, providing a historical background of plotting, a discussion on the grammar of graphics, and an overview of high-level plotting libraries. This is then put to use in a detailed analysis of weather-related data that spans 120 years. Chapter 6, Customization and Configuration, covers the custom styles in matplotlib and the use of grid specs to create a dashboard effect with the combined plots. The lesser-known configuration options are also discussed with an eye to optimization. Chapter 7, Deploying matplotlib in Cloud Environments, explores a use case for matplotlib in a remote deployment, which is followed by a detailed programmatic batch-job example using Docker and Amazon AWS. Chapter 8, matplotlib and Big Data, provides detailed examples of working with large local data sets as well as the distributed ones, covering options such as numpy.memmap, HDF5, and Hadoop. Plots with millions of points will also be demonstrated. Chapter 9, Clustering for matplotlib, introduces parallel programming and clusters that are designed for use with matplotlib, demonstrating how to distribute parts of a problem and then assemble the results for analysis in matplotlib. Hope everyone's having a good time at SciPy 2015! d |
From: Jonno <jon...@gm...> - 2015-07-10 20:25:17
|
Thanks for all the ideas. On Thu, Jul 9, 2015 at 8:09 PM, Joy merwin monteiro <joy...@gm...> wrote: > Maybe you could plot the ratio? That should give you rainfall per degree > Celsius. > On 9 Jul 2015 20:11, "Jonno" <jon...@gm...> wrote: > >> I was thinking of doing that or having 2 surface plots but I think it >> would be visually quite confusing. >> I was trying to think of an example since I'm sure someone has come up >> with a nice way to display this kind of data. >> Imagine if the data was average temperature (a) and average rainfall (b) >> for a region in the world (lat/long = x,y). The goal is to display the data >> such that it's obvious where the locations are that have closest to the >> ideal temp/rain combination. >> How would you go about that? >> >> On Thu, Jul 9, 2015 at 12:28 AM, Sterling Smith <sm...@fu...> >> wrote: >> >>> In the x,y plane, could you overlay contours of a with contours of b? >>> -Sterling >>> >>> On Jul 8, 2015, at 8:19PM, Jonno <jon...@gm...> wrote: >>> >>> > I have a bunch of experimental data points each of which has 2 >>> variables (x,y) and 2 results (a,b). Each pair or x,y values produces a >>> pair of a,b resultant values. >>> > There is a single optimal pair of a,b values and I'd like to figure >>> out a way to illustrate the data to show the relationship between each x,y >>> pair and how close each a,b pair is to the ideal. >>> > I'm thinking about a dual surface/contour plot with 2 different >>> z-axes. Ideally I would center both z-axes at the ideal values. I don't >>> know if this is possible. Might be kinda messy. >>> > >>> > Any other thoughts? I'm sure there must be other examples where this >>> is a problem. >>> > >>> ------------------------------------------------------------------------------ >>> > Don't Limit Your Business. Reach for the Cloud. >>> > GigeNET's Cloud Solutions provide you with the tools and support that >>> > you need to offload your IT needs and focus on growing your business. >>> > Configured For All Businesses. Start Your Cloud Today. >>> > >>> https://www.gigenetcloud.com/_______________________________________________ >>> > Matplotlib-users mailing list >>> > Mat...@li... >>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Don't Limit Your Business. Reach for the Cloud. >> GigeNET's Cloud Solutions provide you with the tools and support that >> you need to offload your IT needs and focus on growing your business. >> Configured For All Businesses. Start Your Cloud Today. >> https://www.gigenetcloud.com/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> |
From: Benjamin R. <ben...@ou...> - 2015-07-10 16:47:44
|
Your theta and phi were essentially 1D rather than 2D, so it didn't allow for 2 degrees of freedom. And you don't need np.outer() for this: theta = np.linspace(0, np.pi, 500)[:, None] phi = np.linspace(0, 2*np.pi, 500)[None, :] r = f(theta, phi) x = r**2 * np.cos(phi) * np.sin(theta) y = r**2 * np.sin(phi) * np.sin(theta) z = r**2 * np.cos(theta) The use of np.outer() in the original example acted a bit like a creating a grid of u/v values in a 2D grid. However, your formulation required computing a 2D grid of radius values in order to work correctly. Cheers! Ben Root On Fri, Jul 10, 2015 at 7:54 AM, Romain Madar <rom...@ce...> wrote: > Dear experts, > > I am trying to plot spherical harmonics with matplotlib and I have some > troubles. I am starting from the example > http://matplotlib.org/examples/mplot3d/surface3d_demo2.html where I > change the factor 10 in a function of r=f(theta,phi) (or r=f(u,v) as they > are named in the example). I observe very strange behaviours: > > (1) (x,y,z) = (r cos(phi) sin(theta) , r sin(phi) sin(theta) , r > cos(theta)). But np.outer(a,b) is not commutative while the multiplication > is. So how to choose the order in the np.outer() product? In fact, > different order gives very different results. > > (2) It's seem impossible to reproduce the well known Ylm(theta,phi) plots. > Using for example this document > http://www.cs.dartmouth.edu/~wjarosz/publications/dissertation/appendixB.pdf > : > > > > > > I don't know if I am doing something wrong or so, but I don't understand > ... My full code is bellow. > > Thanks a lot in advance ! > Cheers, > Romain > > > PS: > > import math > import numpy as np > import pylab as p > from mpl_toolkits.mplot3d import Axes3D > > def f(theta,phi): > return np.sin(phi)*np.cos(phi)*np.sin(theta)**2 > > fig = p.figure() > ax = fig.add_subplot(111, projection='3d') > > theta = np.linspace(0, np.pi, 500) > phi = np.linspace(0, 2*np.pi, 500) > > r = f(theta,phi) > x = r**2 * np.outer( np.cos(phi) , np.sin(theta) ) > y = r**2 * np.outer( np.sin(phi) , np.sin(theta) ) > z = r**2 * np.outer(np.ones(phi.shape), np.cos(theta)) > > #x = r**2 * np.outer( np.sin(theta) , np.cos(phi) > ) > > #y = r**2 * np.outer( np.sin(theta) , np.sin(phi) ) > #z = r**2 * np.outer( np.cos(theta), np.ones(theta.shape) ) > > ax.plot_surface(x,y,z) > ax.set_xlabel("X") > ax.set_ylabel("Y") > ax.set_zlabel("Z") > > p.show() > > > -- > ========================================================= > Romain Madar > > Laboratoire de Physique Corpusculaire de Clermont-Ferrand > Campus Universitaire des Cézeaux > 4 avenue Blaise Pascal > TSA 60026, CS 60026 > 63178 Aubière cedex, FRANCE > > Email: rom...@ce... > Tel. : +33 (0)4 73 40 71 57 > Off. : 8204-8205 > ========================================================= > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Benjamin R. <ben...@ou...> - 2015-07-10 15:02:19
|
The way matplotlib does its MathText rendering is 1) incomplete (we don't support all of MathTex), and 2) has *massive* overhead (relatively speaking). Matplotlib is intended for producing figures with many disparate components. The amount of code it takes to just generate a simple plot is fairly significant (along with also firing up a python interpreter). Meanwhile, MathJax is much lighter in the sense that all it needs to do is parse a string and render out font characters. As for matplotlib vs. MathJax, you will likely sending bitmaps to OpenGL (if possible) anyway because that is pretty much what you will need to do with matplotlib as well as MathJax. It is technically possible to obtain the stroke data to send the font lines to OpenGL, but it will not look the same as it would if you let a font renderer generate the bitmap. There are a few reasons why matplotlib does not have an OpenGL backend yet, one of them is because OpenGL does a terrible job in rendering text. This is not to say that what you are thinking of doing is impossible to do. It may be quite possible, but given that no one (that I am aware of) have managed to get matplotlib running on a mobile OS, you have a huge undertaking ahead of you just to get started. And, once you get there, it is quite likely that the performance won't be what you need. In addition, you might not like the resulting render. More power to you if you can get it working, and I know many people who are interested in getting that stack working on tablets and such. On the other hand, there are plenty of documentation on how to build mobile apps that take advantage of javascript-based technologies. Your startup cost is very low here. And given that you will likely going to need to use bitmaps anyway, it might not be all that bad of an option. I have no clue what the performance penalty of firing up a javascript renderer on a mobile OS, but in the face of the unknown, I avoid guessing. Don't fall victim to premature optimization. I have been very surprised at how fast certain (slow) technologies can be. A minimalist LaTeX distro is an intriguing idea. I have no clue how much effort it would take to do that, but that may be quite feasible. Best of luck to you, and I look forward to finding out what you manage to get working. Cheers! Ben Root On Fri, Jul 10, 2015 at 4:37 AM, asiga <asi...@ya...> wrote: > Why do you suggest MathJax? I assume Javascript will be less efficient than > Python. Moreover, I'm not sure I can get the MathJax output as polygonal > primitives that I can send to OpenGL. And, to complicate things, you cannot > use JIT Javascript engines on iOS such as V8, due to sandboxing. > > In fact, I'm considering to build myself a minimal LaTeX distro. Maybe that > would be the best option. > > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Efficient-matplotlib-use-on-iOS-and-Android-apps-tp45901p45914.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Thomas C. <tca...@gm...> - 2015-07-10 14:32:06
|
See http://matplotlib.org/1.4.3/faq/installing_faq.html?highlight=install#linux-notes On Fri, Jul 10, 2015, 9:10 AM Varada Anirudhan <var...@gm...> wrote: > Hello there > > When I was trying to install matplotlib, the output said that I needed to > install freetype and png first > > How do I install freetype and png on my Ubuntu 14.04 powered-Linux system? > Please help me with the lines of code for this installation > > Thanks in advance > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/how-to-install-freetype-png-for-matplotlib-tp45916.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Varada A. <var...@gm...> - 2015-07-10 14:07:25
|
Hello there When I was trying to install matplotlib, the output said that I needed to install freetype and png first How do I install freetype and png on my Ubuntu 14.04 powered-Linux system? Please help me with the lines of code for this installation Thanks in advance -- View this message in context: http://matplotlib.1069221.n5.nabble.com/how-to-install-freetype-png-for-matplotlib-tp45916.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Romain M. <rom...@ce...> - 2015-07-10 11:54:18
|
Dear experts, I am trying to plot spherical harmonics with matplotlib and I have some troubles. I am starting from the example http://matplotlib.org/examples/mplot3d/surface3d_demo2.html where I change the factor 10 in a function of r=f(theta,phi) (or r=f(u,v) as they are named in the example). I observe very strange behaviours: (1) (x,y,z) = (r cos(phi) sin(theta) , r sin(phi) sin(theta) , r cos(theta)). But np.outer(a,b) is not commutative while the multiplication is. So how to choose the order in the np.outer() product? In fact, different order gives very different results. (2) It's seem impossible to reproduce the well known Ylm(theta,phi) plots. Using for example this document http://www.cs.dartmouth.edu/~wjarosz/publications/dissertation/appendixB.pdf : I don't know if I am doing something wrong or so, but I don't understand ... My full code is bellow. Thanks a lot in advance ! Cheers, Romain PS: import math import numpy as np import pylab as p from mpl_toolkits.mplot3d import Axes3D def f(theta,phi): return np.sin(phi)*np.cos(phi)*np.sin(theta)**2 fig = p.figure() ax = fig.add_subplot(111, projection='3d') theta = np.linspace(0, np.pi, 500) phi = np.linspace(0, 2*np.pi, 500) r = f(theta,phi) x = r**2 * np.outer( np.cos(phi) , np.sin(theta) ) y = r**2 * np.outer( np.sin(phi) , np.sin(theta) ) z = r**2 * np.outer(np.ones(phi.shape), np.cos(theta)) #x = r**2 * np.outer( np.sin(theta) , np.cos(phi) ) #y = r**2 * np.outer( np.sin(theta) , np.sin(phi) ) #z = r**2 * np.outer( np.cos(theta), np.ones(theta.shape) ) ax.plot_surface(x,y,z) ax.set_xlabel("X") ax.set_ylabel("Y") ax.set_zlabel("Z") p.show() -- ========================================================= Romain Madar Laboratoire de Physique Corpusculaire de Clermont-Ferrand Campus Universitaire des Cézeaux 4 avenue Blaise Pascal TSA 60026, CS 60026 63178 Aubière cedex, FRANCE Email: rom...@ce... Tel. : +33 (0)4 73 40 71 57 Off. : 8204-8205 ========================================================= |
From: asiga <asi...@ya...> - 2015-07-10 08:37:53
|
Why do you suggest MathJax? I assume Javascript will be less efficient than Python. Moreover, I'm not sure I can get the MathJax output as polygonal primitives that I can send to OpenGL. And, to complicate things, you cannot use JIT Javascript engines on iOS such as V8, due to sandboxing. In fact, I'm considering to build myself a minimal LaTeX distro. Maybe that would be the best option. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Efficient-matplotlib-use-on-iOS-and-Android-apps-tp45901p45914.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Joy m. m. <joy...@gm...> - 2015-07-10 01:09:22
|
Maybe you could plot the ratio? That should give you rainfall per degree Celsius. On 9 Jul 2015 20:11, "Jonno" <jon...@gm...> wrote: > I was thinking of doing that or having 2 surface plots but I think it > would be visually quite confusing. > I was trying to think of an example since I'm sure someone has come up > with a nice way to display this kind of data. > Imagine if the data was average temperature (a) and average rainfall (b) > for a region in the world (lat/long = x,y). The goal is to display the data > such that it's obvious where the locations are that have closest to the > ideal temp/rain combination. > How would you go about that? > > On Thu, Jul 9, 2015 at 12:28 AM, Sterling Smith <sm...@fu...> > wrote: > >> In the x,y plane, could you overlay contours of a with contours of b? >> -Sterling >> >> On Jul 8, 2015, at 8:19PM, Jonno <jon...@gm...> wrote: >> >> > I have a bunch of experimental data points each of which has 2 >> variables (x,y) and 2 results (a,b). Each pair or x,y values produces a >> pair of a,b resultant values. >> > There is a single optimal pair of a,b values and I'd like to figure out >> a way to illustrate the data to show the relationship between each x,y pair >> and how close each a,b pair is to the ideal. >> > I'm thinking about a dual surface/contour plot with 2 different z-axes. >> Ideally I would center both z-axes at the ideal values. I don't know if >> this is possible. Might be kinda messy. >> > >> > Any other thoughts? I'm sure there must be other examples where this is >> a problem. >> > >> ------------------------------------------------------------------------------ >> > Don't Limit Your Business. Reach for the Cloud. >> > GigeNET's Cloud Solutions provide you with the tools and support that >> > you need to offload your IT needs and focus on growing your business. >> > Configured For All Businesses. Start Your Cloud Today. >> > >> https://www.gigenetcloud.com/_______________________________________________ >> > Matplotlib-users mailing list >> > Mat...@li... >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Ronquillo, E. N. <ero...@la...> - 2015-07-09 19:25:20
|
Yeah it makes sense. I still can't find the bug, which it most likely is. I will keep looking and see what i find. Thanks for the help -----Original Message----- From: Eric Firing [mailto:ef...@ha...] Sent: Tuesday, June 30, 2015 1:11 PM To: mat...@li... Subject: Re: [Matplotlib-users] TypeError: Dimensions of C (645, 536) are incompatible with X (538) and/or Y (646); see help(pcolormesh) On 2015/06/30 6:41 AM, Benjamin Root wrote: > It looks like your X data is one element larger than it needs to be. I > know pcolor() accepts grids that are (N+1,M+1), and I *think* > pcolormesh does the same. It will also accept grids that are (N,M) as > well, but will drop the last row and collumn. Yes, pcolormesh and pcolor use the same argument parsing and checking. They actually *want* N+1, M+1; the *acceptance* of N, M is a matlab-ism that is convenient for quick looks, but is also a potential source of error. The OP has an X dimension of M+2, which indicates an error earlier in the OP's code. Eric ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Sterling S. <sm...@fu...> - 2015-07-09 16:50:46
|
Can you be more specific about the problem you are having? -Sterling On Jul 9, 2015, at 9:40AM, peter <com...@ya...> wrote: > hi, > > my code was working fine, but now i cant figure out what went wrong. > any ideas? > > the code is supposed to plot a timeseries which it does and overlay it with another that is partially defined > the input file is contructed like this: > the first line is just for information purposes. > after that: > the first row is a growing number (the x value), the second is the timeseries and the third is the partially defined second timeseries > > this is the code, after the code is a example input file. > the code is also accessible via this paste service: https://dpaste.de/5ZrX it got a nice python code formatter. > > • def plotTimeSeriesAndSAX(inputfile_tmp, verbose=False): > • > • if verbose: > • print "plotTimeSeriesAndSAX()" > • print "\tinputfile:", inputfile_tmp > • print "\toutputfile: %s.png" % inputfile_tmp > • > • inputfile = open(inputfile_tmp, "r"); > • > • > • # this holds my timeseries > • x = [] > • y = [] > • > • # this holds my "pattern" > • pattern_x_values = [] > • pattern_y_values = [] > • > • # these are for temporary use only, hold the current pattern data > • tmp_x = [] > • tmp_y = [] > • > • > • # remove pattern/sax string, sax_string_with_Z from the datafile, only used as text in the plot > • first_line = inputfile.readline() > • pattern, sax, sax_string_with_Z = first_line.split() > • > • > • > • > • for line in inputfile.readlines(): > • > • data = line.split() > • x_data = data[0] > • y_data = data[1] > • > • #if there is a third line (pattern at this position) > • if len(data) == 3: > • y2_data = data[2] > • tmp_y.append(y2_data) > • tmp_x.append(x_data) > • else: > • # if the pattern ends, add it to pattern_x/y_value and clear the tmp list > • if len(tmp_x) != 0: > • pattern_x_values.append(tmp_x) > • pattern_y_values.append(tmp_y) > • tmp_x = [] > • tmp_y = [] > • > • > • x.append(x_data) > • y.append(y_data) > • > • #if pattern == "ccd": > • # print "pattern x_values:", pattern_x_values > • # print "pattern y_values:", pattern_y_values > • if verbose: > • print "\ttimeseries y value", y > • print "pattern x_values:", pattern_x_values > • print "pattern y_values:", pattern_y_values > • > • > • > • colors = ["red", "magenta", "mediumblue", "darkorchid", "grey"] > • #linestyle = ["-", "--"] > • > • # without this, the second plot contains the first and the second > • # the third plot contains: the first, second and third > • plot.clf() > • > • # plot all my patterns into the plot > • for s in range(0,len(pattern_x_values)): > • #if verbose: > • # print "\tpattern x value:", pattern_x_values[s] > • # print "\tpattern y value:", pattern_y_values[s] > • > • plot.plot(pattern_x_values[s], pattern_y_values[s], colors[1]) > • > • > • #plot.plot(x_all[0], y_all[0]) > • > • > • import matplotlib.patches as mpatches > • > • > • #red_patch = mpatches.Patch(color='red', label='The red data') > • > • from time import gmtime, strftime > • current_date = strftime("%Y-%m-%d %H:%M:%S", gmtime()) > • > • > • fig = plot.figure() > • > • > • fig.text(0, 0, 'bottom-left corner') > • fig.text(0, 1, current_date, ha='left', va='top') > • mytext = "pattern: %s sax: %s sax with Z: %s" % (pattern, sax, sax_string_with_Z) > • fig.text(1,1, mytext ) > • > • > • # add the original timeseries to the plot > • plot.plot(x,y, "forestgreen") > • #if pattern == "ccd": > • # plot.show() > • > • > • directory, filename = os.path.split(inputfile_tmp) > • > • plot.savefig(os.path.join(directory, "plots/%s.png" % filename))#, bbox_inches='tight') > • # remove the last figure from memory > • #plot.close() > • > • > • > • > • > • > • > • > • #input: > • dee ccccccccccaacddeedcccccccdc ZZZZZZZZZZZZZZdeeZZZZZZZZZZ > • 1 -0.015920084 > • 2 -0.044660769 > • 3 -0.044660769 > • 4 -0.092561907 > • 5 0.012820599 > • 6 -0.015920084 > • 7 0.012820599 > • 8 -0.054240996 > • 9 0.031981054 > • 10 0.031981054 > • 11 -0.025500313 > • 12 -0.044660769 > • 13 0.012820599 > • 14 -0.025500313 > • 15 0.0032403709 > • 16 -0.006339857 > • 17 0.0032403709 > • 18 -0.025500313 > • 19 0.031981054 > • 20 0.031981054 > • 21 0.031981054 > • 22 0.022400826 > • 23 0.031981054 > • 24 0.05114151 > • 25 0.079882193 > • 26 0.05114151 > • 27 0.05114151 > • 28 0.05114151 > • 29 0.099042646 > • 30 0.060721738 > • 31 -0.015920084 > • 32 -0.054240996 > • 33 0.23316584 > • 34 0.26190652 > • 35 0.37686926 > • 36 0.12778333 > • 37 -0.044660769 > • 38 -0.26500601 > • 39 -0.41828965 > • 40 -0.38954897 > • 41 -0.26500601 > • 42 -0.14046305 > • 43 -0.073401452 > • 44 -0.12130259 > • 45 -0.082981679 > • 46 -0.14046305 > • 47 -0.054240996 > • 48 -0.082981679 > • 49 -0.015920084 > • 50 -0.073401452 > • 51 -0.015920084 > • 52 0.10862288 > • 53 1.1816084 > • 54 -1.3379915 > • 55 -4.6335899 > • 56 -6.74124 > • 57 -4.7772933 > • 58 -3.4839626 > • 59 -2.075669 > • 60 -1.0984858 > • 61 -0.37038851 > • 62 -0.063821223 > • 63 0.11820311 > • 64 0.13736356 > • 65 0.15652401 > • 66 0.11820311 > • 67 0.32896812 > • 68 0.27148675 > • 69 0.30022744 > • 70 0.31938789 > • 71 0.3577088 0.5449999999999999 > • 72 0.40560994 0.5449999999999999 > • 73 0.44393085 0.5449999999999999 > • 74 0.49183198 0.5449999999999999 > • 75 0.67385632 0.5449999999999999 > • 76 0.79839928 0.84 > • 77 0.9995841 0.84 > • 78 1.1528677 0.84 > • 79 1.4115338 0.84 > • 80 1.5552373 0.84 > • 81 1.7468418 0.84 > • 82 1.7755825 0.84 > • 83 1.7276813 0.84 > • 84 1.4115338 0.84 > • 85 1.0858061 0.84 > • 86 0.65469586 > • 87 0.43435063 > • 88 0.21400538 > • 89 0.14694379 > • 90 0.089462421 > • 91 0.070301966 > • 92 0.031981054 > • 93 0.05114151 > • 94 0.070301966 > • 95 0.13736356 > • 96 0.079882193 > • 97 0.12778333 > • 98 0.15652401 > • 99 0.16610425 > • 100 0.13736356 > • 101 0.13736356 > • 102 0.089462421 > • 103 0.2523263 > • 104 0.21400538 > • 105 0.22358561 > • 106 0.1852647 > • 107 0.19484493 > • 108 0.1852647 > • 109 0.16610425 > • 110 0.13736356 > • 111 0.15652401 > • 112 0.14694379 > • 113 0.16610425 > • 114 0.099042646 > • 115 0.12778333 > • 116 0.13736356 > • 117 0.089462421 > • 118 0.079882193 > • 119 0.089462421 > • 120 0.041561282 > • 121 0.041561282 > • 122 0.079882193 > • 123 0.11820311 > • 124 0.099042646 > • 125 0.089462421 > • 126 0.05114151 > • 127 0.17568447 > • 128 0.30022744 > • 129 0.32896812 > • 130 0.42477039 > • 131 0.17568447 > • 132 0.022400826 > • 133 -0.20752464 > • 134 -0.24584556 > • 135 -0.24584556 > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Brendan B. <bre...@br...> - 2015-07-09 16:50:40
|
On 2015-07-09 07:40, Jonno wrote: > I was thinking of doing that or having 2 surface plots but I think it > would be visually quite confusing. > I was trying to think of an example since I'm sure someone has come up > with a nice way to display this kind of data. > Imagine if the data was average temperature (a) and average rainfall (b) > for a region in the world (lat/long = x,y). The goal is to display the > data such that it's obvious where the locations are that have closest to > the ideal temp/rain combination. > How would you go about that? It's not an easy thing to visualize in general. You might want to look at approaches to visualizing complex functions (i.e., functions whose input and output are both complex variables). These essentially map pairs (a, b) to pairs (x, y) as in your situation, and mathematicians have come up with various ways to visualize them. Some are described at https://www.pacifict.com/ComplexFunctions.html and the wikipedia article at https://en.wikipedia.org/wiki/Complex_analysis has some links in the references to web pages for graphing such functions. If the data are measured at (or can be reasonably reduced to) discrete points (as temp/rainfall are likely to be), another possibility is a scatterplot using, say, the color and size of the markers as indicators of the two variables (e.g., red/blue for hot/cold temp, larger/smaller circles for higher/lower rainfall). In some cases, like your example with temperature and rainfall, you may instead be able to combine the two output dimensions into a single one that somehow captures the overall "distance" from the ideal point. That is, for a given point, if your goal is to show how close it is to the ideal *combination* of temp and rain, you may not need to display how close it is on each dimension separately, but just how close it is to the ideal overall. Exactly how to compute this would vary based on the data (e.g., standardizing the values and taking the euclidean distance from the ideal). Your temp/rainfall example caught my eye because a few years ago I did a blog post on a similar topic, considering temperature and humidity (http://iq.brenbarn.net/2011/11/18/good-days-mate/). There I decided to graph just a single variable, namely the number of days on which either temperature *or* humidity is outside a "comfortable" range. Obviously this approach may not make sense for every situation. But what I mean is that, in some cases, you can use domain-specific knowledge about what the dimensions mean to combine them into one dimension that approximates what it is you're trying to illustrate with the graph. -- Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown |
From: peter <com...@ya...> - 2015-07-09 16:49:32
|
On 07/09/2015 06:40 PM, peter wrote: > hi, > > my code was working fine, but now i cant figure out what went wrong. > any ideas? > > the code is supposed to plot a timeseries which it does and overlay it > with another that is partially defined > the input file is contructed like this: > the first line is just for information purposes. > after that: > the first row is a growing number (the x value), the second is the > timeseries and the third is the partially defined second timeseries > > this is the code, after the code is a example input file. > the code is also accessible via this paste service: > https://dpaste.de/5ZrX it got a nice python code formatter. > ups, the last mail had a leading number from dpaste, this is the code without: def plotTimeSeriesAndSAX(inputfile_tmp, verbose=False): if verbose: print "plotTimeSeriesAndSAX()" print "\tinputfile:", inputfile_tmp print "\toutputfile: %s.png" % inputfile_tmp inputfile = open(inputfile_tmp, "r"); # this holds my timeseries x = [] y = [] # this holds my "pattern" pattern_x_values = [] pattern_y_values = [] # these are for temporary use only, hold the current pattern data tmp_x = [] tmp_y = [] # remove pattern/sax string, sax_string_with_Z from the datafile, only used as text in the plot first_line = inputfile.readline() pattern, sax, sax_string_with_Z = first_line.split() for line in inputfile.readlines(): data = line.split() x_data = data[0] y_data = data[1] #if there is a third line (pattern at this position) if len(data) == 3: y2_data = data[2] tmp_y.append(y2_data) tmp_x.append(x_data) else: # if the pattern ends, add it to pattern_x/y_value and clear the tmp list if len(tmp_x) != 0: pattern_x_values.append(tmp_x) pattern_y_values.append(tmp_y) tmp_x = [] tmp_y = [] x.append(x_data) y.append(y_data) #if pattern == "ccd": # print "pattern x_values:", pattern_x_values # print "pattern y_values:", pattern_y_values if verbose: print "\ttimeseries y value", y print "pattern x_values:", pattern_x_values print "pattern y_values:", pattern_y_values colors = ["red", "magenta", "mediumblue", "darkorchid", "grey"] #linestyle = ["-", "--"] # without this, the second plot contains the first and the second # the third plot contains: the first, second and third plot.clf() # plot all my patterns into the plot for s in range(0,len(pattern_x_values)): #if verbose: # print "\tpattern x value:", pattern_x_values[s] # print "\tpattern y value:", pattern_y_values[s] plot.plot(pattern_x_values[s], pattern_y_values[s], colors[1]) #plot.plot(x_all[0], y_all[0]) import matplotlib.patches as mpatches #red_patch = mpatches.Patch(color='red', label='The red data') from time import gmtime, strftime current_date = strftime("%Y-%m-%d %H:%M:%S", gmtime()) fig = plot.figure() fig.text(0, 0, 'bottom-left corner') fig.text(0, 1, current_date, ha='left', va='top') mytext = "pattern: %s sax: %s sax with Z: %s" % (pattern, sax, sax_string_with_Z) fig.text(1,1, mytext ) # add the original timeseries to the plot plot.plot(x,y, "forestgreen") #if pattern == "ccd": # plot.show() directory, filename = os.path.split(inputfile_tmp) plot.savefig(os.path.join(directory, "plots/%s.png" % filename))#, bbox_inches='tight') # remove the last figure from memory #plot.close() dee ccccccccccaacddeedcccccccdc ZZZZZZZZZZZZZZdeeZZZZZZZZZZ 1 -0.015920084 2 -0.044660769 3 -0.044660769 4 -0.092561907 5 0.012820599 6 -0.015920084 7 0.012820599 8 -0.054240996 9 0.031981054 10 0.031981054 11 -0.025500313 12 -0.044660769 13 0.012820599 14 -0.025500313 15 0.0032403709 16 -0.006339857 17 0.0032403709 18 -0.025500313 19 0.031981054 20 0.031981054 21 0.031981054 22 0.022400826 23 0.031981054 24 0.05114151 25 0.079882193 26 0.05114151 27 0.05114151 28 0.05114151 29 0.099042646 30 0.060721738 31 -0.015920084 32 -0.054240996 33 0.23316584 34 0.26190652 35 0.37686926 36 0.12778333 37 -0.044660769 38 -0.26500601 39 -0.41828965 40 -0.38954897 41 -0.26500601 42 -0.14046305 43 -0.073401452 44 -0.12130259 45 -0.082981679 46 -0.14046305 47 -0.054240996 48 -0.082981679 49 -0.015920084 50 -0.073401452 51 -0.015920084 52 0.10862288 53 1.1816084 54 -1.3379915 55 -4.6335899 56 -6.74124 57 -4.7772933 58 -3.4839626 59 -2.075669 60 -1.0984858 61 -0.37038851 62 -0.063821223 63 0.11820311 64 0.13736356 65 0.15652401 66 0.11820311 67 0.32896812 68 0.27148675 69 0.30022744 70 0.31938789 71 0.3577088 0.5449999999999999 72 0.40560994 0.5449999999999999 73 0.44393085 0.5449999999999999 74 0.49183198 0.5449999999999999 75 0.67385632 0.5449999999999999 76 0.79839928 0.84 77 0.9995841 0.84 78 1.1528677 0.84 79 1.4115338 0.84 80 1.5552373 0.84 81 1.7468418 0.84 82 1.7755825 0.84 83 1.7276813 0.84 84 1.4115338 0.84 85 1.0858061 0.84 86 0.65469586 87 0.43435063 88 0.21400538 89 0.14694379 90 0.089462421 91 0.070301966 92 0.031981054 93 0.05114151 94 0.070301966 95 0.13736356 96 0.079882193 97 0.12778333 98 0.15652401 99 0.16610425 100 0.13736356 101 0.13736356 102 0.089462421 103 0.2523263 104 0.21400538 105 0.22358561 106 0.1852647 107 0.19484493 108 0.1852647 109 0.16610425 110 0.13736356 111 0.15652401 112 0.14694379 113 0.16610425 114 0.099042646 115 0.12778333 116 0.13736356 117 0.089462421 118 0.079882193 119 0.089462421 120 0.041561282 121 0.041561282 122 0.079882193 123 0.11820311 124 0.099042646 125 0.089462421 126 0.05114151 127 0.17568447 128 0.30022744 129 0.32896812 130 0.42477039 131 0.17568447 132 0.022400826 133 -0.20752464 134 -0.24584556 135 -0.24584556 |
From: Mark B. <ma...@gm...> - 2015-07-09 16:41:52
|
Fails on MacOSX backend. Just tried it, and it works fine with the QT backend. So I guess a MacOSX bug... Thanks for your help, Mark On Thu, Jul 9, 2015 at 6:18 PM, Sterling Smith <sm...@fu...> wrote: > Works for me with TkAgg backend on 1.4.3. > > -Sterling > > On Jul 9, 2015, at 3:52AM, Mark Bakker <ma...@gm...> wrote: > > > Hello list, > > > > I am trying to set the backgroundcolor of a textbox: > > > > from pylab import * > > plot([1, 2, 3]) > > text(1, 2, 'Hello', backgroundcolor = 'red') > > > > This plots a nice red box but no text. It looks like the backgroundcolor > is set as the foreground. Am I doing something wrong or is this a bug? mpl > version 1.4.3 > > > > Thanks, Mark > > > > > ------------------------------------------------------------------------------ > > Don't Limit Your Business. Reach for the Cloud. > > GigeNET's Cloud Solutions provide you with the tools and support that > > you need to offload your IT needs and focus on growing your business. > > Configured For All Businesses. Start Your Cloud Today. > > > https://www.gigenetcloud.com/_______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: peter <com...@ya...> - 2015-07-09 16:41:52
|
hi, my code was working fine, but now i cant figure out what went wrong. any ideas? the code is supposed to plot a timeseries which it does and overlay it with another that is partially defined the input file is contructed like this: the first line is just for information purposes. after that: the first row is a growing number (the x value), the second is the timeseries and the third is the partially defined second timeseries this is the code, after the code is a example input file. the code is also accessible via this paste service: https://dpaste.de/5ZrX it got a nice python code formatter. 1. def plotTimeSeriesAndSAX(inputfile_tmp, verbose=False): 2. 3. if verbose: 4. print "plotTimeSeriesAndSAX()" 5. print "\tinputfile:", inputfile_tmp 6. print "\toutputfile: %s.png" % inputfile_tmp 7. 8. inputfile = open(inputfile_tmp, "r"); 9. 10. 11. # this holds my timeseries 12. x = [] 13. y = [] 14. 15. # this holds my "pattern" 16. pattern_x_values = [] 17. pattern_y_values = [] 18. 19. # these are for temporary use only, hold the current pattern data 20. tmp_x = [] 21. tmp_y = [] 22. 23. 24. # remove pattern/sax string, sax_string_with_Z from the datafile, only used as text in the plot 25. first_line = inputfile.readline() 26. pattern, sax, sax_string_with_Z = first_line.split() 27. 28. 29. 30. 31. for line in inputfile.readlines(): 32. 33. data = line.split() 34. x_data = data[0] 35. y_data = data[1] 36. 37. #if there is a third line (pattern at this position) 38. if len(data) == 3: 39. y2_data = data[2] 40. tmp_y.append(y2_data) 41. tmp_x.append(x_data) 42. else: 43. # if the pattern ends, add it to pattern_x/y_value and clear the tmp list 44. if len(tmp_x) != 0: 45. pattern_x_values.append(tmp_x) 46. pattern_y_values.append(tmp_y) 47. tmp_x = [] 48. tmp_y = [] 49. 50. 51. x.append(x_data) 52. y.append(y_data) 53. 54. #if pattern == "ccd": 55. # print "pattern x_values:", pattern_x_values 56. # print "pattern y_values:", pattern_y_values 57. if verbose: 58. print "\ttimeseries y value", y 59. print "pattern x_values:", pattern_x_values 60. print "pattern y_values:", pattern_y_values 61. 62. 63. 64. colors = ["red", "magenta", "mediumblue", "darkorchid", "grey"] 65. #linestyle = ["-", "--"] 66. 67. # without this, the second plot contains the first and the second 68. # the third plot contains: the first, second and third 69. plot.clf() 70. 71. # plot all my patterns into the plot 72. for s in range(0,len(pattern_x_values)): 73. #if verbose: 74. # print "\tpattern x value:", pattern_x_values[s] 75. # print "\tpattern y value:", pattern_y_values[s] 76. 77. plot.plot(pattern_x_values[s], pattern_y_values[s], colors[1]) 78. 79. 80. #plot.plot(x_all[0], y_all[0]) 81. 82. 83. import matplotlib.patches as mpatches 84. 85. 86. #red_patch = mpatches.Patch(color='red', label='The red data') 87. 88. from time import gmtime, strftime 89. current_date = strftime("%Y-%m-%d%H:%M:%S", gmtime()) 90. 91. 92. fig = plot.figure() 93. 94. 95. fig.text(0, 0, 'bottom-left corner') 96. fig.text(0, 1, current_date, ha='left', va='top') 97. mytext = "pattern: %ssax: %ssax with Z: %s" % (pattern, sax, sax_string_with_Z) 98. fig.text(1,1, mytext ) 99. 100. 101. # add the original timeseries to the plot 102. plot.plot(x,y, "forestgreen") 103. #if pattern == "ccd": 104. # plot.show() 105. 106. 107. directory, filename = os.path.split(inputfile_tmp) 108. 109. plot.savefig(os.path.join(directory, "plots/%s.png" % filename))#, bbox_inches='tight') 110. # remove the last figure from memory 111. #plot.close() 112. 113. 114. 115. 116. 117. 118. 119. 120. #input: 121. dee ccccccccccaacddeedcccccccdc ZZZZZZZZZZZZZZdeeZZZZZZZZZZ 122. 1 -0.015920084 123. 2 -0.044660769 124. 3 -0.044660769 125. 4 -0.092561907 126. 5 0.012820599 127. 6 -0.015920084 128. 7 0.012820599 129. 8 -0.054240996 130. 9 0.031981054 131. 10 0.031981054 132. 11 -0.025500313 133. 12 -0.044660769 134. 13 0.012820599 135. 14 -0.025500313 136. 15 0.0032403709 137. 16 -0.006339857 138. 17 0.0032403709 139. 18 -0.025500313 140. 19 0.031981054 141. 20 0.031981054 142. 21 0.031981054 143. 22 0.022400826 144. 23 0.031981054 145. 24 0.05114151 146. 25 0.079882193 147. 26 0.05114151 148. 27 0.05114151 149. 28 0.05114151 150. 29 0.099042646 151. 30 0.060721738 152. 31 -0.015920084 153. 32 -0.054240996 154. 33 0.23316584 155. 34 0.26190652 156. 35 0.37686926 157. 36 0.12778333 158. 37 -0.044660769 159. 38 -0.26500601 160. 39 -0.41828965 161. 40 -0.38954897 162. 41 -0.26500601 163. 42 -0.14046305 164. 43 -0.073401452 165. 44 -0.12130259 166. 45 -0.082981679 167. 46 -0.14046305 168. 47 -0.054240996 169. 48 -0.082981679 170. 49 -0.015920084 171. 50 -0.073401452 172. 51 -0.015920084 173. 52 0.10862288 174. 53 1.1816084 175. 54 -1.3379915 176. 55 -4.6335899 177. 56 -6.74124 178. 57 -4.7772933 179. 58 -3.4839626 180. 59 -2.075669 181. 60 -1.0984858 182. 61 -0.37038851 183. 62 -0.063821223 184. 63 0.11820311 185. 64 0.13736356 186. 65 0.15652401 187. 66 0.11820311 188. 67 0.32896812 189. 68 0.27148675 190. 69 0.30022744 191. 70 0.31938789 192. 71 0.3577088 0.5449999999999999 193. 72 0.40560994 0.5449999999999999 194. 73 0.44393085 0.5449999999999999 195. 74 0.49183198 0.5449999999999999 196. 75 0.67385632 0.5449999999999999 197. 76 0.79839928 0.84 198. 77 0.9995841 0.84 199. 78 1.1528677 0.84 200. 79 1.4115338 0.84 201. 80 1.5552373 0.84 202. 81 1.7468418 0.84 203. 82 1.7755825 0.84 204. 83 1.7276813 0.84 205. 84 1.4115338 0.84 206. 85 1.0858061 0.84 207. 86 0.65469586 208. 87 0.43435063 209. 88 0.21400538 210. 89 0.14694379 211. 90 0.089462421 212. 91 0.070301966 213. 92 0.031981054 214. 93 0.05114151 215. 94 0.070301966 216. 95 0.13736356 217. 96 0.079882193 218. 97 0.12778333 219. 98 0.15652401 220. 99 0.16610425 221. 100 0.13736356 222. 101 0.13736356 223. 102 0.089462421 224. 103 0.2523263 225. 104 0.21400538 226. 105 0.22358561 227. 106 0.1852647 228. 107 0.19484493 229. 108 0.1852647 230. 109 0.16610425 231. 110 0.13736356 232. 111 0.15652401 233. 112 0.14694379 234. 113 0.16610425 235. 114 0.099042646 236. 115 0.12778333 237. 116 0.13736356 238. 117 0.089462421 239. 118 0.079882193 240. 119 0.089462421 241. 120 0.041561282 242. 121 0.041561282 243. 122 0.079882193 244. 123 0.11820311 245. 124 0.099042646 246. 125 0.089462421 247. 126 0.05114151 248. 127 0.17568447 249. 128 0.30022744 250. 129 0.32896812 251. 130 0.42477039 252. 131 0.17568447 253. 132 0.022400826 254. 133 -0.20752464 255. 134 -0.24584556 256. 135 -0.24584556 |