SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
S M T W T F S




1
(14)
2
(3)
3
4
5
6
(6)
7
(8)
8
(5)
9
10
11
12
(7)
13
(1)
14
15
(2)
16
(5)
17
(8)
18
19
(1)
20
(2)
21
(3)
22
(1)
23
(3)
24
(1)
25
26
27
28
29
(5)
30
(3)
31

Showing 7 results of 7

From: Asma R. <asm...@gm...> - 2014年05月12日 17:08:56
Hi,
I have generated a heat map along side a tree with gridspec. The issue is
that I want the tree with smaller dimensions and heat map should be in a
square dimension, adjusting height ratios and width ration only helps
reduce tree and the heat map dimensions increase.
Here is my code:
 gs=gridspec.GridSpec(1, 2,height_ratios=[1,1,-2,2]
,width_ratios=[0.5,1,-2,2],hspace=0,wspace=0)
 phyl_ax=plt.subplot(gs[0,0])
 Phylo.draw(tree, axes=phyl_ax, do_show=False,show_confidence=False)
 ht_ax=plt.subplot(gs[0,1])
Hence I decided to use add_subplots instead:
from mpl_toolkits.axes_grid1 import make_axes_locatable,Size
from Bio import Phylo
 fig= plt.figure()
 phyl_ax=fig.add_subplot(1,2,1)
 ht_ax=fig.add_subplot(1,2,2)
 fig.subplots_adjust(hspace=0,wspace=0)
 divider1 = make_axes_locatable(phyl_ax)
 divider1.get_horizontal()[0] = Size.Fixed(5.0) # 10 inch
 divider1.get_vertical()[0] = Size.Fixed(10.0) # 4 inch
 Phylo.draw(tree, axes=phyl_ax, do_show=False,show_confidence=False)
 divider2 = make_axes_locatable(ht_ax)
 divider2.get_horizontal()[0] = Size.Fixed(10.0) # 5 inch
 divider2.get_vertical()[0] = Size.Fixed(10.0) # 5 inch
 divider = make_axes_locatable(ht_ax)
 cbax = divider.append_axes("right", size="5%", pad=0.10)
Note:The width of the subplots is what I am trying to make different
and height should be the same.
With the above code the tree subplot is appearing in the background and
heat map on top of it, rather than adjacent.
Could anyone help me out with this?
Thanks
Asma
From: Phil E. <pel...@gm...> - 2014年05月12日 16:29:00
Hi Maik,
Not entirely sure what you're after (a picture may have helped), but I know
Basemap has relatively recently added rotated pole coordinate system
support which may be of use. I'm not sure how well that goes with the
meridian/parallel drawing within Basemap though.
Alternatively, if I've understood you correctly, I've put together an
example using cartopy which first produces a map in "Geomagnetic" space
(with traditional latitude and longitude meridians/parallels) and then by
drawing a north polar stereographic map first with the geomagnetic
latitudes and longitudes (for 2010) next to the WGS84 latitudes and
longitudes.
Notebook can be found
http://nbviewer.ipython.org/gist/pelson/7b461a798e454533d4ef
The key is that you can make a map of any projection, and later add data
from any source coordinate system (transform) and they should play nicely
in Cartopy.
Is this the kind of thing you're after?
Cheers,
Phil
On 12 May 2014 13:18, Maik Riechert <mai...@ar...> wrote:
> Hi,
>
> I'm drawing a stereographic map, my data is in geographic latitude,
> longitude coordinates. But instead of drawing parallels/meridians based
> on the geographic poles I need to draw them based on the geomagnetic
> poles, that is, the poles are rotated. E.g. in 2010 the north
> geomagnetic pole was at 80.08°N 72.21°W
> (https://en.wikipedia.org/wiki/Geomagnetic_pole). In my case it's for
> aurora research, and many existing maps are drawn in this way, so
> naturally it becomes easier to compare them if they are based on the
> same coordinate system.
>
> Is this somehow achievable with basemap? Note that I'd like to draw
> country borders etc. as well. (Otherwise I could just transform my
> geographic coordinates to magnetic coordinates and use standard basemap.)
>
> Thanks
> Maik
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform
> available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Thøger Rivera-T. <tho...@gm...> - 2014年05月12日 15:17:06
I usually get around this by writing my plotting routines as functions
that take Axes objects as input. That way, they don't need to know about
the layout of the figure, and I can use the same code for figures with
one or more axes.
I am working on a project involving a sample of galaxies, and sometimes
I need a plot parameter A for one of the galaxies only, in a figure
together with plots of parameters B and C for the same galaxy. Other
times, I need a figure with plots of parameter A only, but with an Axes
for each galaxy in the sample. This approach allows me to use the same
code for both cases.
/Emil
On 2014年05月12日 17:06, Yuxiang Wang wrote:
> Hi Eric,
>
> Thank you for your very clear explanation.
>
> -Shawn
>
> On Mon, May 12, 2014 at 3:23 AM, Eric Firing <ef...@ha...> wrote:
>> On 2014年05月11日 7:56 PM, Yuxiang Wang wrote:
>>> Dear all,
>>>
>>> I am curious that whether this is possible in matplotlib:
>>>
>>> I first create some figures, with subplots.
>>>
>>> import matplotlib.pyplot as plt
>>> fig1, axs1 = plt.subplots(2, 2)
>>> fig2, axs2 = plt.subplots(2, 2)
>>>
>>> And then, could I recombine them, so fig3 is composed of the first row
>>> in fig1 (i.e., axs1[0, 0] and axs1[0, 1]) and second row in fig2
>>> (i.e., axs2[1, 0] and axs2[1, 1])?
>>>
>>> Currently, all I could do is to re-plot them. I am curious about
>>> whether there is a way that I can just move axes around and re-combine
>>> them to make new figures. Thanks!
>> No, there is no facility for doing this. The Axes class is always
>> initialized with a Figure instance. The Axes and Figure are quite
>> tightly tied together via transforms.
>>
>> Eric
>>
>>> -Shawn
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
>> Instantly run your Selenium tests across 300+ browser/OS combos.
>> Get unparalleled scalability from the best Selenium testing platform available
>> Simple to use. Nothing to install. Get started now for free."
>> http://p.sf.net/sfu/SauceLabs
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Yuxiang W. <yw...@vi...> - 2014年05月12日 15:07:03
Hi Eric,
Thank you for your very clear explanation.
-Shawn
On Mon, May 12, 2014 at 3:23 AM, Eric Firing <ef...@ha...> wrote:
> On 2014年05月11日 7:56 PM, Yuxiang Wang wrote:
>> Dear all,
>>
>> I am curious that whether this is possible in matplotlib:
>>
>> I first create some figures, with subplots.
>>
>> import matplotlib.pyplot as plt
>> fig1, axs1 = plt.subplots(2, 2)
>> fig2, axs2 = plt.subplots(2, 2)
>>
>> And then, could I recombine them, so fig3 is composed of the first row
>> in fig1 (i.e., axs1[0, 0] and axs1[0, 1]) and second row in fig2
>> (i.e., axs2[1, 0] and axs2[1, 1])?
>>
>> Currently, all I could do is to re-plot them. I am curious about
>> whether there is a way that I can just move axes around and re-combine
>> them to make new figures. Thanks!
>
> No, there is no facility for doing this. The Axes class is always
> initialized with a Figure instance. The Axes and Figure are quite
> tightly tied together via transforms.
>
> Eric
>
>>
>> -Shawn
>>
>>
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Yuxiang "Shawn" Wang
Gerling Research Lab
University of Virginia
yw...@vi...
+1 (434) 284-0836
https://sites.google.com/a/virginia.edu/yw5aj/
From: Maik R. <mai...@ar...> - 2014年05月12日 12:18:22
Hi,
I'm drawing a stereographic map, my data is in geographic latitude, 
longitude coordinates. But instead of drawing parallels/meridians based 
on the geographic poles I need to draw them based on the geomagnetic 
poles, that is, the poles are rotated. E.g. in 2010 the north 
geomagnetic pole was at 80.08°N 72.21°W 
(https://en.wikipedia.org/wiki/Geomagnetic_pole). In my case it's for 
aurora research, and many existing maps are drawn in this way, so 
naturally it becomes easier to compare them if they are based on the 
same coordinate system.
Is this somehow achievable with basemap? Note that I'd like to draw 
country borders etc. as well. (Otherwise I could just transform my 
geographic coordinates to magnetic coordinates and use standard basemap.)
Thanks
Maik
From: Eric F. <ef...@ha...> - 2014年05月12日 07:23:25
On 2014年05月11日 7:56 PM, Yuxiang Wang wrote:
> Dear all,
>
> I am curious that whether this is possible in matplotlib:
>
> I first create some figures, with subplots.
>
> import matplotlib.pyplot as plt
> fig1, axs1 = plt.subplots(2, 2)
> fig2, axs2 = plt.subplots(2, 2)
>
> And then, could I recombine them, so fig3 is composed of the first row
> in fig1 (i.e., axs1[0, 0] and axs1[0, 1]) and second row in fig2
> (i.e., axs2[1, 0] and axs2[1, 1])?
>
> Currently, all I could do is to re-plot them. I am curious about
> whether there is a way that I can just move axes around and re-combine
> them to make new figures. Thanks!
No, there is no facility for doing this. The Axes class is always 
initialized with a Figure instance. The Axes and Figure are quite 
tightly tied together via transforms.
Eric
>
> -Shawn
>
>
From: Yuxiang W. <yw...@vi...> - 2014年05月12日 05:56:37
Dear all,
I am curious that whether this is possible in matplotlib:
I first create some figures, with subplots.
import matplotlib.pyplot as plt
fig1, axs1 = plt.subplots(2, 2)
fig2, axs2 = plt.subplots(2, 2)
And then, could I recombine them, so fig3 is composed of the first row
in fig1 (i.e., axs1[0, 0] and axs1[0, 1]) and second row in fig2
(i.e., axs2[1, 0] and axs2[1, 1])?
Currently, all I could do is to re-plot them. I am curious about
whether there is a way that I can just move axes around and re-combine
them to make new figures. Thanks!
-Shawn
-- 
Yuxiang "Shawn" Wang
Gerling Research Lab
University of Virginia
yw...@vi...
+1 (434) 284-0836
https://sites.google.com/a/virginia.edu/yw5aj/

Showing 7 results of 7

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /