Re: [Matplotlib-users] stem plot with horizontal offset (BaseValue)
Looking at the source code indicates there is a 'bottom' keyword which looks like it controls this, see https://github.com/matplotlib/matplotlib/blob/v1.4.3/lib/matplotlib/axes/_axes.py#L2295 On 31 March 2015 at 19:31, ssinfod ssin...@gmail.com wrote: Hello, I found this stem plot example: http://matplotlib.org/examples/pylab_examples/stem_plot.html I would like to add an horizontal offset to the step plot. (Ex: +2 on Y axis) What is the equivalent of the Matlab BaseValue offset in matplotlib. See Reference: http://www.mathworks.com/help/matlab/ref/stemseries-properties.html http://stackoverflow.com/questions/21913995/vertically-offset-stem-plot Thanks, ssinfod -- View this message in context: http://matplotlib.1069221.n5.nabble.com/stem-plot-with-horizontal-offset-BaseValue-tp45297.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] 1.3 + xkcd + latex
For what it is worth I see behaviour identical to Neal. I'm using a development version of matplotlib (v1.4.x, sorry I don't know the hash of the installed version) on 64-bit Linux (Ubuntu 12.04) and Python 2.7.3. That probably doesn't help much, except to show that this is not specific to just Neal! Andrew On 18 October 2013 14:40, Michael Droettboom md...@stsci.edu wrote: This is really puzzling. What version of matplotlib are you running, what platform, and what version of Python? Your example works just fine for me. Mike On 10/18/2013 08:40 AM, Neal Becker wrote: Neal Becker wrote: This example shows the error on my platform - the xlabel is not rendered with tex but instead the '$' are printed: import numpy as np import matplotlib.pyplot as plt plt.xkcd() fig = fig = plt.figure() ax = fig.add_subplot(111) plt.plot (np.arange (10), 2*np.arange(10)) ax.set_xlabel ('$E_{s}/N_{0}$') plt.show() And without plt.xkcd() the tex is rendered correctly -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- _ |\/|o _|_ _. _ | | \.__ __|__|_|_ _ _ ._ _ | ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | | http://www.droettboom.com -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Dr Andrew Dawson Atmospheric, Oceanic Planetary Physics Clarendon Laboratory Parks Road Oxford OX1 3PU, UK Tel: +44 (0)1865 282438 Email: daw...@atm.ox.ac.uk Web Site: http://www2.physics.ox.ac.uk/contacts/people/dawson -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60135031iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Hovemuller Diagram
I meant the coordinates, so one representing latitude or longitude and one representing time (filled with datetime objects), should be 1d. This only applies if your coordinate actually contains datetime objects, if not then coordinates can be 2d as the documentation says. On 13 Jul 2013 02:22, Sudheer Joseph sudheer.jos...@yahoo.com wrote: Hi, I did not understand 1d mentioned by you? for a diagram like this 2D is must as it need longitude /latitude and also time with best regards, Sudheer From: Andrew Dawson daw...@atm.ox.ac.uk To: Phil Elson pelson@gmail.com Cc: Sudheer Joseph sudheer.jos...@yahoo.com; matplotlib-users@lists.sourceforge.net matplotlib-users@lists.sourceforge.net Sent: Friday, 12 July 2013 1:28 PM Subject: Re: [Matplotlib-users] Hovemuller Diagram As long as you use contour or contourf and your coordinates are 1d you should be able to do this no problem, just like Phil said. However, there is a bug that will prevent you from using pcolormesh or pcolor unfortunately. Andrew On 12 July 2013 08:51, Phil Elson pelson@gmail.com wrote: The balance of time to install vs time to re-implement a feature is only something you can decide, but i suspect it is worth your while getting iris installed (I would say that as an iris developer though). The installation process is only going to get easier over time, for instance last week we added a PPA so that with the necessary repos added you would be able to apt-get install python-iris on an Ubuntu machine - for other installation guides there is a repository of recipes ( https://github.com/SciTools/installation-recipes ). As for achieving this without iris, it is perfectly feasible. You just need to contourf your data with the longitude as your x coordinate and the date times as your y coordinate. From memory you might also need to tell matplotlib that the y coordinate is date/time (I think that is a mpl bug that ajdawson has recently addressed). Obviously, basemap is not needed as you are not drawing a longitude/latitude plot but a longitude/time or latitude/time one. HTH, Phil On 11 July 2013 19:06, Sudheer Joseph sudheer.jos...@yahoo.com wrote: Thank you Signell, I was looking for better looking labels as well as a solution with in matplotlib without needing to install additional packages. I had some trouble with some libraries while trying to install iris. I was wondering if it is possible with in matplotlib with out additional installations using the features of basemap package. with best regards, Sudheer *** Sudheer Joseph Indian National Centre for Ocean Information Services Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) E-mail:sjo.in...@gmail.com;sudheer.jos...@yahoo.com Web- http://oppamthadathil.tripod.com *** - Original Message - From: Signell, Richard rsign...@usgs.gov To: Sudheer Joseph sudheer.jos...@yahoo.com Cc: Sent: Friday, 12 July 2013 12:41 AM Subject: Re: [Matplotlib-users] Hovemuller Diagram I don't think I understand your problem. Are you just trying to get nicer looking tick labels? On Thu, Jul 11, 2013 at 11:03 AM, Sudheer Joseph sudheer.jos...@yahoo.com wrote: Thanks Signell, I had seen it but it is not the correct type with Longitude axis, it is having just numbers on x axis I expect axis like the ones we get from basemap package. with best regards, sudheer *** Sudheer Joseph Indian National Centre for Ocean Information Services Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) E-mail:sjo.in...@gmail.com;sudheer.jos...@yahoo.com Web- http://oppamthadathil.tripod.com *** - Original Message - From: Signell, Richard rsign...@usgs.gov To: Sudheer Joseph sudheer.jos...@yahoo.com Cc: Sent: Thursday, 11 July 2013 7:20 PM Subject: Re: [Matplotlib-users] Hovemuller Diagram http://scitools.org.uk/iris/docs/v1.0/examples/graphics/hovmoller.html On Thu, Jul 11, 2013 at 5:40 AM, Sudheer Joseph sudheer.jos...@yahoo.com wrote: Dear All, Is there a straight forward way to get Hovemuller diagram or longitude/latitude vs time plot using matplotlib. If possible please send me some examples if any one know it existing
Re: [Matplotlib-users] removing paths inside polygon
Thanks, the clipping is working now. But as you say the weird line width issue still remains for Agg (and png, perhaps that uses Agg, I don't know...). PDF output looks correct. On 20 March 2013 05:48, Jae-Joon Lee lee.j.j...@gmail.com wrote: On Wed, Mar 13, 2013 at 2:17 AM, Andrew Dawson daw...@atm.ox.ac.ukwrote: You should see that the circle is no longer circular, and also there are weird line width issues. What I want it basically exactly like the attached without_clipping.png but with paths inside the circle removed. The reason that circle is no more circle is that simply inverting the vertices does not always results in a correctly inverted path. Instead of following line. interior.vertices = interior.vertices[::-1] You should use something like below. interior = mpath.Path(np.concatenate([interior.vertices[-2::-1], interior.vertices[-1:]]), interior.codes) It would be good if we have a method to invert a path. This will give you a circle. But the weird line width issue remains. This seems to be an Agg issue, and the line width seems to depend on the dpi. I guess @mdboom nay have some insight on this. Regards, -JJ -- Dr Andrew Dawson Atmospheric, Oceanic Planetary Physics Clarendon Laboratory Parks Road Oxford OX1 3PU, UK Tel: +44 (0)1865 282438 Email: daw...@atm.ox.ac.uk Web Site: http://www2.physics.ox.ac.uk/contacts/people/dawson -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] removing paths inside polygon
Hi I'd like to be able to clip a line so that the portion of it lying outside of a given polygon remains visible and the part that lies inside of the polygon is not visible. What I want is basically the opposite of: line.set_clip_path(polygon) which leaves only the part of the line inside the polygon visible. Is this possible? I know I can just fill the polygon with the background color or something but this gets messy when there are other lines on the plot that don't need to be clipped. Thanks, Andrew -- Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and remains a good choice in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] dash length for dashed contours
Hi all, [TL;DR: is it possible to control the length of the dashes in dashed contours, if so how?] I'd like to be able to control the length of dashes for dashed contours. My motivation is that I'm making a contour plot that uses dashes for the negative contours, and the plot needs to be a specific (small) size for the particular journal, so the small size of the plot makes the dashes look rather long and is a problem for some tight contours. I have tried using some a dashes-style argument for the linestyles keyword of contour but I can't get it to work (although I appreciate it is not documented as something one can do). For example I tried: import matplotlib.pyplot as plt import numpy as np x = y = np.linspace(-np.pi, np.pi, 100) X, Y = np.meshgrid(x, y) Z = np.sin(X) * np.cos(Y) plt.contour(x, y, Z, linestyles=[(3, 3)]) plt.show() This fails at the point where I show (or save, doesn't matter which backend) the plot with a PyCXX error: TypeError: PyCXX: Error creating object of type N2Py7SeqBaseINS_6ObjectEEE from 3 I've fiddled with several other styles of argument and all fail in a similar way. What I'd like to know is: is it possible to control the dash length of dashed contours at all? It seems like it should be as one can do this with lines easy enough. I looked through the code, and a dashes-style argument seems to get passed through the stack correctly, but fails when the Collection is drawn. It would be a really nice feature if this could be implemented in matplotlib. Thanks, Andrew -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] 3d animated scatter plot
Hi I'm trying to plot the trajectory of a particle in 3d using mplot3d. I tried to follow the example of an animated 3d plot on the matplotlib website but I'm having trouble with the updating of the data point being plotted at each frame. Does anyone know how to do this? So far I have: import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d.axes3d import Axes3D from matplotlib.animation import FuncAnimation def update_plot(num, data, sc): sc.set_array(data[num]) return sc def main(): numframes = 2 data = np.random.rand(10, 3)# a (time, position) array fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ix, iy, iz = data[0] sc = ax.scatter(ix, iy, iz, c='k') ani = FuncAnimation(fig, update_plot, frames=numframes, fargs=(data,sc)) plt.show() if __name__ == '__main__': main() This just changes the color of the initial marker. I also tried to use sc.set_3d_properties but it is not clear to me what the arguments should be here, I kept getting an error... If anyone has done this before I'd love to see an example. Thanks, Andrew -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users