Re: [Matplotlib-users] multiple plots on single axis
On 2014/11/27, 4:55 AM, Bala subramanian wrote: > Friends, > > I want to make multiple graphs on a single axes. As an example, i am > pasting below an article where it has been shown. > > http://www.ncbi.nlm.nih.gov/pubmed/23403925 > > My plot of interest is *Figure7B*, where multiple distribution are > depicted in single plot. I want to make a similar one. Kindly give me > some insights on how i can make it with mpl, if anyone have achieved > making it with mpl. Fig 7b is just a set of curves with sequential offsets in x, right? A LineCollection can be nice for this. See the last panel in http://matplotlib.org/examples/api/collections_demo.html. Eric > > Thanks in advance, > Bala > > > -- > C. Balasubramanian > -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] passing multiple path arguments to make_compound_path
Hi, put all them into a list ps = [p1, p2, ..., pn] and then unpack them path.Path.make_compound_path(*ps) Cheers, Fra ps: this is standard python unpacking 2014-11-27 18:12 GMT+01:00 Evan Mason : > Hi, I have several path objects that I want to join together with > make_compound_path. > > For example, with p1 and p2: > > In [136]: p1 > Out[136]: > Path(array([[-29.85721973, -30.], >[-29.84752676, -29.77715877], >[-29.88734508, -29.55431755], >[-29.97470553, -29.33147632], >[-30., -29.28831083]]), None) > > In [138]: p2 > Out[138]: > Path(array([[-30., 45.166 ], >[-29.94756898, 45.09749304], >[-29.87227011, 45.32033426], >[-29.84525888, 45.54317549], >[-29.86787108, 45.76601671], >[-29.93898847, 45.98885794], >[-30., 46.10595725]]), None) > > I can do path.Path.make_compound_path(p1, p2) which joins them > successfully. > If I have a another path, p3, I can do: > path.Path.make_compound_path(p1, p2,p3), and so on. > > However, in my script I never know how many paths I will have, so I'd like > to put them into some sort of container, and pass that to > make_compound_path. I've tried lists: > > > In [140]: p1p2 = [p1, p2] > > In [141]: path.Path.make_compound_path(p1p2) > --- > AttributeErrorTraceback (most recent call last) > in () > > 1 path.Path.make_compound_path(p1p2) > > /usr/lib64/python2.7/site-packages/matplotlib-1.4.2-py2.7-linux-x86_64.egg > /matplotlib/path.py > in make_compound_path(cls, *args) > 330 total_length = sum(lengths) > 331 > --> 332 vertices = np.vstack([x.vertices for x in args]) > 333 vertices.reshape((total_length, 2)) > 334 > > AttributeError: 'list' object has no attribute 'vertices' > > > without success. Can anybody suggest a way to do this? > > Thanks, Evan > > > > -- > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] passing multiple path arguments to make_compound_path
Hi, I have several path objects that I want to join together with make_compound_path. For example, with p1 and p2: In [136]: p1 Out[136]: Path(array([[-29.85721973, -30.], [-29.84752676, -29.77715877], [-29.88734508, -29.55431755], [-29.97470553, -29.33147632], [-30., -29.28831083]]), None) In [138]: p2 Out[138]: Path(array([[-30., 45.166 ], [-29.94756898, 45.09749304], [-29.87227011, 45.32033426], [-29.84525888, 45.54317549], [-29.86787108, 45.76601671], [-29.93898847, 45.98885794], [-30., 46.10595725]]), None) I can do path.Path.make_compound_path(p1, p2) which joins them successfully. If I have a another path, p3, I can do: path.Path.make_compound_path(p1, p2,p3), and so on. However, in my script I never know how many paths I will have, so I'd like to put them into some sort of container, and pass that to make_compound_path. I've tried lists: In [140]: p1p2 = [p1, p2] In [141]: path.Path.make_compound_path(p1p2) --- AttributeErrorTraceback (most recent call last) in () > 1 path.Path.make_compound_path(p1p2) /usr/lib64/python2.7/site-packages/matplotlib-1.4.2-py2.7-linux-x86_64.egg /matplotlib/path.py in make_compound_path(cls, *args) 330 total_length = sum(lengths) 331 --> 332 vertices = np.vstack([x.vertices for x in args]) 333 vertices.reshape((total_length, 2)) 334 AttributeError: 'list' object has no attribute 'vertices' without success. Can anybody suggest a way to do this? Thanks, Evan -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] multiple plots on single axis
Check out the third example in the gallery: Gallery Link: http://matplotlib.org/gallery.html Direct Link: http://matplotlib.org/examples/lines_bars_and_markers/fill_demo_features.html On Thu, Nov 27, 2014 at 6:55 AM, Bala subramanian wrote: > Friends, > > I want to make multiple graphs on a single axes. As an example, i am > pasting below an article where it has been shown. > > http://www.ncbi.nlm.nih.gov/pubmed/23403925 > > My plot of interest is *Figure7B*, where multiple distribution are > depicted in single plot. I want to make a similar one. Kindly give me some > insights on how i can make it with mpl, if anyone have achieved making it > with mpl. > > Thanks in advance, > Bala > > > -- > C. Balasubramanian > > > -- > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] multiple plots on single axis
you could go with something like this: import matplotlib.pyplot as plt import numpy as np fig, ax = plt.subplots(1, 10, figsize=(10,3)) fig.subplots_adjust(wspace=0) for i,axi in enumerate(ax): axi.axis((0,1,0,1)) axi.xaxis.set_ticks([]) axi.yaxis.set_ticks([]) if i is 0: axi.xaxis.tick_bottom() axi.yaxis.tick_left() axi.spines['right'].set_visible(False) axi.spines['top'].set_visible(False) axi.spines['left'].set_bounds(0, 1) axi.spines['bottom'].set_bounds(0, 1) axi.yaxis.set_ticks(np.linspace(0,1,5)) axi.yaxis.set_ticklabels(np.linspace(0,1,5)) axi.xaxis.set_ticks(np.linspace(0,1,3)) axi.xaxis.set_ticklabels(np.linspace(0,1,3)) if i > 0: axi.set_frame_on(False) axi.plot(np.random.rand(10), np.random.rand(10)) On Nov 27, 2014, at 4:55 PM, Bala subramanian wrote: > Friends, > > I want to make multiple graphs on a single axes. As an example, i am pasting > below an article where it has been shown. > > http://www.ncbi.nlm.nih.gov/pubmed/23403925 > > My plot of interest is Figure7B, where multiple distribution are depicted in > single plot. I want to make a similar one. Kindly give me some insights on > how i can make it with mpl, if anyone have achieved making it with mpl. > > Thanks in advance, > Bala > > > -- > C. Balasubramanian > -- > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] multiple plots on single axis
Friends, I want to make multiple graphs on a single axes. As an example, i am pasting below an article where it has been shown. http://www.ncbi.nlm.nih.gov/pubmed/23403925 My plot of interest is *Figure7B*, where multiple distribution are depicted in single plot. I want to make a similar one. Kindly give me some insights on how i can make it with mpl, if anyone have achieved making it with mpl. Thanks in advance, Bala -- C. Balasubramanian -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users