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


Showing 16 results of 16

From: Pekeika <m.e...@um...> - 2009年12月03日 22:23:58
Matthias,
And I saw your code now :) and it pretty much looks like mine, with some
more or less formatting. Attached is one of my figures where you can see my
result!
http://old.nabble.com/file/p26634326/Spill%2BVerification%2Bof%2Btwenty%252C%2Bhigh%2Bu%2Bagain%2Bafter%2Bchange%2Bpredicted%2Bat%2Btime%2B7.79%2Bdays.jpeg 
-- 
View this message in context: http://old.nabble.com/How-to-display-axis-numbers-inside-the-figure-area-tp26578109p26634326.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Pekeika <m.e...@um...> - 2009年12月03日 22:16:30
Matthias,
Thanks for answering. I already solved my problem. I found that there is no
function to display on grids the value of the axis (bad when you need to
display lat, longitude)... so I made it myself using the text() function and
using yticks() and xticks() along with all the formatting properties, all
inside of the text function...
Its pretty nice now,
Angelica.
-- 
View this message in context: http://old.nabble.com/How-to-display-axis-numbers-inside-the-figure-area-tp26578109p26634238.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Tony S Yu <ts...@gm...> - 2009年12月03日 21:46:49
On Dec 3, 2009, at 3:58 PM, Jae-Joon Lee wrote:
> line 1486 of _backend_agg.cpp says
> 
> /* TODO: Support clip paths */
> 
> So, it seems that, apparently, clipping with arbitrary path has not
> been implemented yet for gouraud shading (pcolormesh will be properly
> clipped if shading is not used).
> I hope Michael pick this up some time soon.
> 
> Meanwhile, you may open a feature request ticket on this.
> 
> Regards,
> 
> -JJ
Hey Jae-Joon,
Thanks for digging into this. Feature request added.
By the way, I was looking through the feature requests and noticed an open feature request (ID: 2112292) that was satisfied by the addition of spines in the last major release. Just an FYI, if someone with privileges wants to close the request.
Thanks,
-Tony
From: Jae-Joon L. <lee...@gm...> - 2009年12月03日 21:36:54
On Thu, Dec 3, 2009 at 3:40 PM, Ryan Neve <rya...@gm...> wrote:
>
> I tried all sorts of things, but finally, by setting aspect=False I got it
> to work. In the documentation, the table says this defaults to True and the
> explanation of aspect below says it defaults to False. Although I don't
> entirely understand what is going on, I think this threw me off.
> So then I had this:
>
Can you be more specific about which documentation says the default aspect
is False? This may need to be fixed. Note that AxesGrid is designed
for displaying images with aspect=True. Otherwise, you may better stick to
the subplot..
> [image: 84Kna.png]
> ... which looks much better, except that there are two sets of x and y axis
> labels? This seems to have something to do with the colorbar. I've got:
>
>
To me, there is another axes underneath the AxesGrid. It is hard to tell
without a complete code.
> label_mode = "L",
> cbar_location="right",
> cbar_mode="each",
> cbar_size="2%",
> cbar_pad="0.5%"
>
> Now I'm trying to get scales and labels on my colorbars.
> I tried:
> for i,parameter in enumerate(z_dim):
> ax = my_grid[i].pcolor(x_grid,y_grid,z_dim[parameter]) # This is the
> pcolor plot
> my_grid[i].set_ylabel('Depth') # Correctly puts a y label on every
> plot.
> cb = my_grid.cbar_axes[i].colorbar(ax) # Puts in a colorbar for this
> axes?s
> cb.set_ylabel(parameter) #It would be nice if this was on the far right
> next to the colorbar. I don't see it anywhere. Perhaps underneath something?
The label of the colorbar is set to invisible by default (this is a bug).
So, try something like
 my_grid.cbar_axes[i].set_ylabel(parameter)
 my_grid.cbar_axes[i].axis["right"].toggle(ticklabels=True,
 label=True)
>
> [image: DPkWz.png]
> It looks like perhaps the colorbar axes is inside the ax axes rather than
> besides it?
> In the demo_grid_with_each_cbar<http://matplotlib.sourceforge.net/examples/axes_grid/demo_axes_grid.html>example, how would you put a scale and label on the colorbar like in this
> plot:?
> [image: 58dFK.png]
> I can put a y_label on each contour plot, but since they all have depth,
> I'd like to label this only once.
> Is there a way to label the entire AxesGrid (or is that subplot?)?
>
>
Does label_mode="1" do what you want?
You may manually make some of the labels invisible.
Please post a "complete", but simple, script that reproduces your problem.
Otherwise, it is hard to track down what is wrong.
Also, please report what version of matplotlib you're using. The axes_grid
toolkit is relatively new and some of the feature may not work in older
versions.
Regards,
-JJ
> Thank you very much for your help,
>
> -Ryan
>
>
>
> On Wed, Dec 2, 2009 at 10:21 PM, Jae-Joon Lee <lee...@gm...>wrote:
>
>> This happens because, when the AxesGrid is created, gca() is set to the
>> last axes, which is the last colobar axes.
>>
>> If you use axes_grid toolkit, you'd better not use pyplot command that
>> works on axes. Instead, use axes method directly.
>>
>> For example, instead of "pyplot.pcolor(..)" , use "ax.pcolor(..)".
>>
>> Regards,
>>
>> -JJ
>>
>>
>>
>>
>> On Wed, Dec 2, 2009 at 2:18 PM, Ryan Neve <rya...@gm...> wrote:
>>
>>> Hello,
>>>
>>> I'm trying to use AxesGrid but I'm running into a problem:
>>> I can plot a single pcolor plot:
>>> [image: 58dFK.png]
>>> But when I try to use AxesGrid, my pcolor plot is ending up where I
>>> expect my colorbar to be.
>>> [image: mEbTA.png]
>>>
>>> I want to have up to 6 of these plots stacked vertically, sharing a
>>> common time axis and y (depth) scale.
>>>
>>> I'll try to simplify my code to show what I'm doing:
>>>
>>> # I have arrays x_grid and y_grid for time and water depth.
>>> # z_dim is a dictionary of arrays (one for each plot)
>>> # In the plot above it has two arrays.
>>> from matplotlib import pyplot
>>> nrows = len(z_dim) # Number of rows is the number of arrays
>>> My_figure = pyplot.figure(1,(8,8))
>>> my_grid = AxesGrid(My_figure, 111, #Is this always 111?
>>> nrows_ncols = (nrows,1), # Always one column
>>> axes_pad = 0.1,
>>> add_all=True,
>>> share_all=True, # They all share the same time and depth
>>> scales
>>> label_mode = "L",
>>> cbar_location="right",
>>> cbar_mode="each",
>>> cbar_size="7%",
>>> cbar_pad="2%",
>>> )
>>> for row_no,parameter in enumerate(z_dim):
>>> ax = my_grid[row_no]
>>> ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter])
>>> pyplot.draw()
>>> pyplot.show()
>>>
>>> I eventually want to end up with something like this matlab output (which
>>> I didn't generate):
>>> [image: jiIaK.png]
>>> but without the duplication of x scales.
>>>
>>> I'm new to pyplot and even after reading the documentation much of this
>>> is baffling.
>>>
>>> -Ryan
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>>> a free event focused on virtualization and cloud computing.
>>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>>> http://p.sf.net/sfu/redhat-sfdev2dev
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
From: Jae-Joon L. <lee...@gm...> - 2009年12月03日 20:59:29
line 1486 of _backend_agg.cpp says
 /* TODO: Support clip paths */
So, it seems that, apparently, clipping with arbitrary path has not
been implemented yet for gouraud shading (pcolormesh will be properly
clipped if shading is not used).
I hope Michael pick this up some time soon.
Meanwhile, you may open a feature request ticket on this.
Regards,
-JJ
On Wed, Dec 2, 2009 at 5:13 PM, Tony S Yu <ts...@gm...> wrote:
>
> On Dec 2, 2009, at 3:53 PM, Tony S Yu wrote:
>
>> Hi,
>>
>> I'm having hard time understanding some of the differences between functions used to plot color patches (not sure what to call them).
>>
>> I'm trying to fill a curve with a nonuniform color patch (like fill or fill_between but the color in the patch varies). I've attached code that almost does what I want; my question concerns the color patch (which is created by the call to plt.pcolor in the code below). I'd like to have nonuniform grid spacing in the color values, and also shading (i.e. interpolation of color between points). Here's what I understand:
>>
>> pcolor: allows nonuniform grid spacing, but it doesn't do shading.
>>
>> imshow: allows color shading, but requires uniform spacing
>>
>> pcolormesh: allows color interpolation and nonuniform grid spacing
>>
>> pcolormesh seems like the ideal candidate, but when I replace pcolor with pcolormesh (code commented out below pcolor call), the path doesn't get clipped by set_clip_path (but no errors are raised); in other words, the color shading fills the entire plot area. Is this a bug?
>>
>> Is there a way of making this plot work that I've overlooked?
>>
>> Thanks!
>> -Tony
>
>
> Nevermind, I found NonUniformImage after some digging. The working code is attached below if anyone is interested.
>
> If anyone knows the answer, I'm still curious if the clipping behavior for pcolormesh is a bug.
>
> Thanks,
> -Tony
>
>
>
> #~~~~ example code
>
> import numpy as np
> import matplotlib.pyplot as plt
> from matplotlib.image import NonUniformImage
>
>
> def nonuniform_imshow(x, y, C, **kwargs):
>  """Plot image with nonuniform pixel spacing.
>
>  This function is a convenience method for calling image.NonUniformImage.
>  """
>  ax = plt.gca()
>  im = NonUniformImage(ax, **kwargs)
>  im.set_data(x, y, C)
>  ax.images.append(im)
>  return im
>
>
> def plot_filled_curve(x, y, c):
>  """Plot curve filled with linear color gradient
>
>  Parameters
>  ----------
>  x, y : arrays
>    points describing curve
>  c : array
>    color values underneath curve. Must match the lengths of `x` and `y`.
>  """
>  # add end points so that fill extends to the x-axis
>  x_closed = np.concatenate([x[:1], x, x[-1:]])
>  y_closed = np.concatenate([[0], y, [0]])
>  # fill between doesn't work here b/c it returns a PolyCollection, plus it
>  # adds the lower half of the plot by adding a Rect with a border
>  patch, = plt.fill(x_closed, y_closed, facecolor='none')
>  im = nonuniform_imshow(x, [0, y.max()], np.vstack((c, c)),
>              interpolation='bilinear', cmap=plt.cm.gray)
>  im.set_clip_path(patch)
>
> if __name__ == '__main__':
>  line = np.linspace(0, 1, 6)
>  x = np.hstack((line, [1, 2]))
>  y = np.hstack((line**2, [1, 1]))
>  c = np.hstack((line, [0, 0]))
>  plot_filled_curve(x, y, c)
>  plt.show()
>
>
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Ryan N. <rya...@gm...> - 2009年12月03日 20:40:22
Thank You,
I think I have a better understanding. In my figure, there are six axes,
three for the plots: grid[i] and three for their colorbars:
grid.cbar_axes[i].
I changed my code as you suggested and got something like:
[image: UKM0g.png]
I tried all sorts of things, but finally, by setting aspect=False I got it
to work. In the documentation, the table says this defaults to True and the
explanation of aspect below says it defaults to False. Although I don't
entirely understand what is going on, I think this threw me off.
So then I had this:
[image: 84Kna.png]
... which looks much better, except that there are two sets of x and y axis
labels? This seems to have something to do with the colorbar. I've got:
 label_mode = "L",
 cbar_location="right",
 cbar_mode="each",
 cbar_size="2%",
 cbar_pad="0.5%"
Now I'm trying to get scales and labels on my colorbars.
I tried:
for i,parameter in enumerate(z_dim):
 ax = my_grid[i].pcolor(x_grid,y_grid,z_dim[parameter]) # This is the
pcolor plot
 my_grid[i].set_ylabel('Depth') # Correctly puts a y label on every plot.
 cb = my_grid.cbar_axes[i].colorbar(ax) # Puts in a colorbar for this
axes?s
 cb.set_ylabel(parameter) #It would be nice if this was on the far right
next to the colorbar. I don't see it anywhere. Perhaps underneath something?
[image: DPkWz.png]
It looks like perhaps the colorbar axes is inside the ax axes rather than
besides it?
In the demo_grid_with_each_cbar<http://matplotlib.sourceforge.net/examples/axes_grid/demo_axes_grid.html>example,
how would you put a scale and label on the colorbar like in this
plot:?
[image: 58dFK.png]
I can put a y_label on each contour plot, but since they all have depth, I'd
like to label this only once.
Is there a way to label the entire AxesGrid (or is that subplot?)?
Thank you very much for your help,
-Ryan
On Wed, Dec 2, 2009 at 10:21 PM, Jae-Joon Lee <lee...@gm...> wrote:
> This happens because, when the AxesGrid is created, gca() is set to the
> last axes, which is the last colobar axes.
>
> If you use axes_grid toolkit, you'd better not use pyplot command that
> works on axes. Instead, use axes method directly.
>
> For example, instead of "pyplot.pcolor(..)" , use "ax.pcolor(..)".
>
> Regards,
>
> -JJ
>
>
>
>
> On Wed, Dec 2, 2009 at 2:18 PM, Ryan Neve <rya...@gm...> wrote:
>
>> Hello,
>>
>> I'm trying to use AxesGrid but I'm running into a problem:
>> I can plot a single pcolor plot:
>> [image: 58dFK.png]
>> But when I try to use AxesGrid, my pcolor plot is ending up where I expect
>> my colorbar to be.
>> [image: mEbTA.png]
>>
>> I want to have up to 6 of these plots stacked vertically, sharing a common
>> time axis and y (depth) scale.
>>
>> I'll try to simplify my code to show what I'm doing:
>>
>> # I have arrays x_grid and y_grid for time and water depth.
>> # z_dim is a dictionary of arrays (one for each plot)
>> # In the plot above it has two arrays.
>> from matplotlib import pyplot
>> nrows = len(z_dim) # Number of rows is the number of arrays
>> My_figure = pyplot.figure(1,(8,8))
>> my_grid = AxesGrid(My_figure, 111, #Is this always 111?
>> nrows_ncols = (nrows,1), # Always one column
>> axes_pad = 0.1,
>> add_all=True,
>> share_all=True, # They all share the same time and depth
>> scales
>> label_mode = "L",
>> cbar_location="right",
>> cbar_mode="each",
>> cbar_size="7%",
>> cbar_pad="2%",
>> )
>> for row_no,parameter in enumerate(z_dim):
>> ax = my_grid[row_no]
>> ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter])
>> pyplot.draw()
>> pyplot.show()
>>
>> I eventually want to end up with something like this matlab output (which
>> I didn't generate):
>> [image: jiIaK.png]
>> but without the duplication of x scales.
>>
>> I'm new to pyplot and even after reading the documentation much of this is
>> baffling.
>>
>> -Ryan
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>> a free event focused on virtualization and cloud computing.
>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>> http://p.sf.net/sfu/redhat-sfdev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
From: Peter I. H. <pe...@gm...> - 2009年12月03日 19:15:34
Hi All
Not really about matplotlib, but since the load() function was removed
it seems we have to use numpy.loadtxt in stead.
I'm reading some datafiles that have comment line beginning with both
'#' and '@'. Is there a way to assign two different values to the
'comments' keyword?
Thanks, Peter
From: Jae-Joon L. <lee...@gm...> - 2009年12月03日 18:30:38
You need to add the patch to the second axes.
patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data',
 axesA=ax1, axesB=ax2,
 zorder=100, arrowstyle='fancy',
 connectionstyle='Angle3',
 mutation_scale=10)
ax2.add_patch(patch)
However, this does not work right out of the box currently (which
should be bug).
As a workaround, add a following line and it will work.
patch.set_annotation_clip(False)
It would be appreciated if you file a bug report for a future reference.
http://sourceforge.net/tracker/?atid=560720&group_id=80706&func=browse
Regards,
-JJ
On Thu, Dec 3, 2009 at 9:31 AM, Stephane Raynaud
<ste...@gm...> wrote:
> Hi,
>
> how to make this arrow not disappear below the right plot?
> Here is the code :
>
> ------------------------------------------------------------
> from matplotlib.patches import *
> import matplotlib.pyplot as P
>
> P.figure(figsize=(5, 3))
> ax1 = P.subplot(121)
> P.plot([0, 1])
> ax2 = P.subplot(122)
> P.plot([0, 1])
>
>
> patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data', axesA=ax1,
> axesB=ax2,
>   zorder=100, arrowstyle='fancy',clip_on=False, connectionstyle='Angle3',
> mutation_scale=100)
> ax1.add_patch(patch)
>
> P.savefig('cross_arrow.png')
> P.show()
> ------------------------------------------------------------
>
>
>
>
> --
> Stephane Raynaud
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jouni K. S. <jk...@ik...> - 2009年12月03日 18:05:56
Matthias Michler <Mat...@gm...> writes:
> Do you know why is happens only for ps/eps-files?
The ps backend uses TeX in a different way than the other backends. It
uses psfrag and dvips to construct the final file.
>> Have you set any TeX-related environment variables or edited any
>> configuration files? What does "kpsepath tex" print?
>
> in my .zshrc I set
> TEXINPUTS=~/Texte/Styles//:.//:
It's probably the .// entry, which causes TeX to search all
subdirectories of the current directory. The ps backend does something
like
cd /tmp && latex file.tex
so it should just look in subdirectories of the temporary directory, but
perhaps it somehow goes awry. Do you have some setting that causes
temporary files to end up in the root directory?
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Jorge S. <jor...@ya...> - 2009年12月03日 09:17:32
Jae-Joon Lee <lee.j.joon@...> writes:
<...>
> 
> It depends on your mileage.
> 
> However, a patch in matplotlib usually means a closed path. If you add
> additional lines, you need to be careful not to mess the filling of
> the rectangle.
> 
> I guess it would better to simply use separate artists for additional
> lines you want. You may create a container artist for patches and
> lines if you want.
> 
> Regards,
> 
> -JJ
Thanks, that's sounds like a better way indeed. I'll work in this direction.
Jorge
From: marcusantonius <mar...@st...> - 2009年12月03日 08:49:09
Thak you very much for pointing this out to me. I was not aware that Inkscape
is able to output to .odg. Unfortunatly export into .odg works badly. I
converted .svg files, and both were rendered totally incorrect. All the axes
labels vanished, in a lineplot it connected the end of the line to the
origin, leading to a diagonal line which should not be there, and the
rasterized image included by pcolorfast was also not included. Therefore I
fear that exporting into .odg is not a usable alternative. 
-- 
View this message in context: http://old.nabble.com/Output-to-any-vector-format-openoffice-can-use-tp26589911p26621731.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2009年12月03日 04:36:44
This would only meaningful if you set contour levels manually.
plt.figure()
levels = [-1, 0, 1]
fmt = {-1.:"-1",
 0.:"0",
 1.:"+1"}
CS = plt.contour(X, Y, Z, levels)
plt.clabel(CS, inline=1, fontsize=10, fmt=fmt)
Regards,
-JJ
On Wed, Dec 2, 2009 at 6:32 AM, Momme Butenschön <mo...@ya...> wrote:
> in the help for the countour plot labeling it says:
>    *fmt*:
>     a format string for the label. Default is '%1.3f'
>     Alternatively, this can be a dictionary matching contour
>     levels with arbitrary strings to use for each contour level
>     (i.e., fmt[level]=string)
> can somebody enlighten me how this works?
> how do I connect levels to what dictionary keyword?
>
> thank a lot,
> Momme
>
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2009年12月03日 03:35:07
On Tue, Dec 1, 2009 at 8:48 AM, Jorge Scandaliaris
<jor...@ya...> wrote:
> How difficult would be to extend the Rectangle class so besides its permimeter
> it draws lines showing halfs or thirds of the width and height?
It depends on your mileage.
However, a patch in matplotlib usually means a closed path. If you add
additional lines, you need to be careful not to mess the filling of
the rectangle.
I guess it would better to simply use separate artists for additional
lines you want. You may create a container artist for patches and
lines if you want.
Regards,
-JJ
From: Jae-Joon L. <lee...@gm...> - 2009年12月03日 03:22:14
This happens because, when the AxesGrid is created, gca() is set to the last
axes, which is the last colobar axes.
If you use axes_grid toolkit, you'd better not use pyplot command that works
on axes. Instead, use axes method directly.
For example, instead of "pyplot.pcolor(..)" , use "ax.pcolor(..)".
Regards,
-JJ
On Wed, Dec 2, 2009 at 2:18 PM, Ryan Neve <rya...@gm...> wrote:
> Hello,
>
> I'm trying to use AxesGrid but I'm running into a problem:
> I can plot a single pcolor plot:
> [image: 58dFK.png]
> But when I try to use AxesGrid, my pcolor plot is ending up where I expect
> my colorbar to be.
> [image: mEbTA.png]
>
> I want to have up to 6 of these plots stacked vertically, sharing a common
> time axis and y (depth) scale.
>
> I'll try to simplify my code to show what I'm doing:
>
> # I have arrays x_grid and y_grid for time and water depth.
> # z_dim is a dictionary of arrays (one for each plot)
> # In the plot above it has two arrays.
> from matplotlib import pyplot
> nrows = len(z_dim) # Number of rows is the number of arrays
> My_figure = pyplot.figure(1,(8,8))
> my_grid = AxesGrid(My_figure, 111, #Is this always 111?
> nrows_ncols = (nrows,1), # Always one column
> axes_pad = 0.1,
> add_all=True,
> share_all=True, # They all share the same time and depth
> scales
> label_mode = "L",
> cbar_location="right",
> cbar_mode="each",
> cbar_size="7%",
> cbar_pad="2%",
> )
> for row_no,parameter in enumerate(z_dim):
> ax = my_grid[row_no]
> ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter])
> pyplot.draw()
> pyplot.show()
>
> I eventually want to end up with something like this matlab output (which I
> didn't generate):
> [image: jiIaK.png]
> but without the duplication of x scales.
>
> I'm new to pyplot and even after reading the documentation much of this is
> baffling.
>
> -Ryan
>
>
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: gbollenbach <whi...@ya...> - 2009年12月03日 02:17:36
Inkscape's native format is svg and it exports in .odg, which OO should be
able to use. I did a test combining a svg vector and png raster and then
saving as .odg, and it wrote the file. But I don't have OO so I can't try
to import the result.
regards,
Gary B
marcusantonius wrote:
> 
> I am searching a way, so that I can insert my matplotlib graphs as vector
> data in openoffice. I make colormaps using pcolorfast. If I save the
> figure as emf, the colormap inside the axes vanishes, because the normal
> emf backend cannot include rasterized data. Is there any way (e.g. using a
> different backend) which gives emf/wmf files which contain the rasterized
> data?
> 
> Is there a convertor from svg to emf which can do the trick? (I tried
> uniconvertor but it also looses the rasterized data). I tried to insert
> svg/eps/pdf files into openoffice, but the results are less than promising
> 
-- 
View this message in context: http://old.nabble.com/Output-to-any-vector-format-openoffice-can-use-tp26589911p26619988.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2009年12月03日 00:44:12
On Sun, Nov 22, 2009 at 11:16 AM, per freem <per...@gm...> wrote:
> is there an existing parameter that just controls the distance between
> the xticks and the label?
As you first tried (with your example with axes_grid), labelpad
parameter does what you want.
plt.xlabel("xlabel", labelpad=0)
or
ax.xaxis.labelpad = 0
It didn't work in your previous example because you were using
axes_grid toolkit, that simply ignores this parameter.
Also, see this
http://matplotlib.sourceforge.net/faq/howto_faq.html#align-my-ylabels-across-multiple-subplots
Regards,
-JJ
5 messages has been excluded from this view by a project administrator.

Showing 16 results of 16

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 によって変換されたページ (->オリジナル) /