http://matplotlib.sourceforge.net/examples/api/demo_affine_image_00.html
This link of the gallery example is broken (error 404). It corresponds
to the third example of the fourth row.
--
Keep Your Developer Skills Current
If all your values are positive (and you are sure of it), you could
use the SymmetricalLogScale It uses log scale for large values (both
positive and negative), and linear for small ones.
http://matplotlib.sourceforge.net/devel/add_new_projection.html
I believe there is a way to do it without go
First, this is another topic, so please, change the subject of the
message so it doesn't get messed up with others (and possible help
lost in the process).
Now, you are indeed plotting one dot at the time and generating a
label for it. If you don't want that, you have to plot the whole list
at the
Hello,
I am trying to type Erdős in the title of a figure. I am using the
LaTeX command Erd\H{o}s, as it works in normal latex documents both in
text and math mode, but it malfunctioning putting the two lines on the
d. To obtain the proper typeset, I have to write:
plt.title(r"$Erdo\H s$")
This
I don't know if there is any reason for not having it, but as a
workaround, you could use np.hist to get the data (syntax is the same
as mpl.hist and returns the same numbers, but without drawing) and
then renormalise and plot with mpl.bars.
On Thu, Jul 12, 2012 at 4:42 PM, Alan G Isaac wrote:
>
On Mon, Jul 16, 2012 at 11:09 AM, Benjamin Jonen wrote:
> 2) The coloring and the way the lines curve around looks very nice to
> me. I remember that the Excel charts did not have this nice look
> before Excel 2007. Can I achieve similar effects with matplotlib? I'm
> not really sure what creates
On Thu, Jul 26, 2012 at 5:05 PM, Andreas Hilboll wrote:
> That's really easy :) I could live with this solution, applying some
> external tool like pdfcrop to the result.
If you can use other output, you can generate a png image, which would
be easier to cut (even inside MPL.image). This, without
In the example you provide, bins is returned by the hist command,
whereas in your code, bins is a number that you defined as 20. So,
change:
bins = 20
plt.hist(C, bins, ...
by:
nbins = 20
n, bins, patches = plt.hist(C, nbins, ...
As a side comment, your data loading is too complex, and fail pr
On Fri, Jul 27, 2012 at 9:57 PM, surfcast23 wrote:
> y = mlab.normpdf( nbins, avg, sigma)
> l = plt.plot(nbins, y, 'r--', linewidth=1)
> plt.show()
You should not change bins there, as you are evaluating the gaussian
function at different values.
Also, sigma is a vector, but it should be an scal
t 11:12 PM, surfcast23 wrote:
>
> Thanks for catching that sigma was still a vector! I am no longer getting the
> errors, but the best fit line is not showing up.Is there something else I am
> missing ?
> BTW thanks for the heads up on the np.mean and np.standard functions.
>
>
On Sat, Jul 28, 2012 at 12:22 AM, surfcast23 wrote:
> Am I reading (bins[1]-bins[0]) correctly as taking the difference between
> what is in the second and first bin?
Yes. I am multipliying the width of the bins by their total height.
Surely there are cleaner and more general ways
(say, when the
On Sunday, September 9, 2012, Eric Firing wrote:
> Regarding the need to pre-allocate: yes, matlab is slicker in this
> regard, and every now and then there is discussion about implementing
> equivalent behavior in numpy, or in an add-on module.
>
Technically, you don´t have to preallocate the me
On Windows it works just fine. Just a wild guess, can you try to make
it a raw string?
plt.xlabel(r'Percent [%]')
On Tue, Oct 9, 2012 at 10:45 PM, Francesco Montesano
wrote:
> Hi
>
> 2012/10/9 Nikolaus Rath
>>
>> Hello,
>>
>> For some reason, my matplotlib isn't able to print percent signs ('%'
On Sun, Oct 14, 2012 at 3:42 AM, Paul Tremblay wrote:
> You don't want to install for python 2.6. Python 2.6 is out of date at
> this point.
I disagree. Most of the tools and libraries for 2.6 are available for
2.7 and viceversa (they are quite similar), but not all of them. In
fact, in my experi
in the terminal type:
sudo port install py26-python
sudo port install py26-matplotlib
and there you are!
On Sun, Oct 14, 2012 at 5:37 AM, lulu wrote:
> Okay -- that's good to know.
> I've just installed macports, but am not sure how to go about using
> matplotlib in my python 2.6 - or even 2.7
I also think that would be useful. It would, for example, allow to
generate "preview" plots from other languages, without interfacing
them to Python. It must be said that MPL is actually quite nice
looking in the default settings for basic plotting, and this is an
nice feature that can exploit.
I
On Fri, Oct 19, 2012 at 11:08 PM, elmar werling wrote:
> vmin=min(z), vmax=max(z)
A suggestion, when dealing with arrays, it is generally faster to use
the numpy function to compute the max and min, either np.max(z) or
z.max(), than the standard Python one.
--
Hello.
I have had an issue trying to plot an histogram with Matplotlib. The line is:
plt.hist([SNIa.angles, SNIbc.angles, SNII.angles], 11, range=[-pi, pi],
normed=True,histtype='stepfilled',color=['g', 'r',
'b'],alpha=[1, 0.6, 1])
But the error is raised when I try to save the image. F
On Sat, Aug 14, 2010 at 10:19 PM, Eric Firing wrote:
> The problem is that the "alpha" kwarg can never be other than a scalar
> in mpl at present, as far as I know. The error message from to_rgba was
> intended to be informative, but in this case it is misleading.
Thanks for your response. I was
What I use to create animations is plainly:
savefig(head+str(filecode).zfill(digits)+format, dpi=205)
plt.clf()
filecode+=1
where filecode is the name, digits an int and format usually .png.
clf() is important in order to prevent memory leaks, because otherwise
mpl stores all the figures one in
I cannot see what is wrong, but after saving each figure you should
add plt.clf() in order to delete the image and preventing memory
leaks, because MPL stores one image in top of the other.
For the filecode I suggest you to use something like:
savefig(head+str(filecode).zfill(digits)+format, dpi=
Image Magick and Inkscape seem to work for this. Probably the first
one is easier to automatize in batch processing.
On Thu, Aug 26, 2010 at 4:21 PM, Michael Droettboom wrote:
> matplotlib does not have any built-in support for any color spaces other
> than RGB. You would need to use an external
If it is only one image, an easy low-tech workaround is to save it as
PNG and then put it into a PDF. This way, you only have to load one
element.
On Mon, Aug 30, 2010 at 11:36 PM, Jeremy Conlin wrote:
> I have a matplotlib plot that I saved to a pdf image. The plot
> consists of 1E5 dots plotte
I think you can make it with pyplot.contourf() and the argument V
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.contour
"contour(Z,V)
contour(X,Y,Z,V)
draw contour lines at the values specified in sequence V"
On Wed, Sep 15, 2010 at 9:02 PM, Luke wrote:
> I have a fun
Does MPL support in any way the Z channel? If not, is there any
possibility to use it? For example, to create a parallel matrix of the
same dimensions of the image with the values of Z in each pixel.
Thank you very much.
David.
clear today. ;-)
On Thu, Sep 16, 2010 at 5:12 PM, Benjamin Root wrote:
> On Thu, Sep 16, 2010 at 12:03 AM, Daπid wrote:
>>
>> Does MPL support in any way the Z channel? If not, is there any
>> possibility to use it? For example, to create a parallel matrix of the
>> s
On Sat, Oct 2, 2010 at 7:39 PM, Jouni K. Seppänen wrote:
>> And yet, we still allow for saving to jpegs.
>
> Wow, I didn't know. Last time I tried that I got a traceback, and
> assumed that it was not supported exactly because jpeg is a nonsensical
> format for most graphs.
Don't forget MPL is al
On Mon, Oct 4, 2010 at 11:36 AM, nickj wrote:
> To better illustrate my problem, here is a screenshot with added red lines
> pointing to the odd slicing I get around the
> contours: http://www.bigoceans.com/slices.png
A low-tech option is to plot first all the oceans in light color, then
overplot
If you are curious, here is what Mathematica can tell about the
integral (assuming everything constant but z):
http://pastebin.com/Gir3XZBe
On Wed, Oct 13, 2010 at 4:28 PM, Waléria Antunes David
wrote:
> Hi all,
>
> I know here is a group for matplotlib, but can anyone help me? I need to
> pas
Hello.
It is stated that show() should be the last function in a script, as
long as it will stop the execution of the program. Nevertheless, I
have seen that the current behavior is just a pause in the flow, and
it will be restored when the window is closed. The documentation says:
"Many users a
On Tue, Nov 2, 2010 at 12:49 PM, David Kremer wrote:
> Personally I used show() yesterday, and it blocks the execution until
> the figure's window is closed. It is of perfect convenience I think,
> as a default behavior.
Yes, this is the optimal behavior, but it is not fully implemented, as
seen
Hello.
I want to plot the result of a calculation, show it, modify and
repeat. I have tried with pyplot interactive mode, see code:
http://pastebin.com/jsdsLN4z
The first plot shows fine, but from now on, all the new plots appear
in a new window and all of them are blank --including the first one
I have checked with all the interpolation modes and the only one that
behaves badly is 'nearest'. There are them:
http://dl.dropbox.com/u/1351211/Interpolation_modes.zip
On Mon, Apr 18, 2011 at 12:46 PM, Emanuele Passera
wrote:
> Hello everybody,
>
> I am experiencing a strange behavior with the
I am using MPL 1.0.1 with Python 2.6 over Windows XP and it works.
I would like to add an advice: range(n) creates a list of size n, and
stores it in memory. But in your code you are only using one number at
a time. Python has a better instruction: xrange. It works exactly like
range, but doesn't
ax.set_xticks(bins)
ax.set_xticklabels(n, rotation='vertical')
The first one is for creating the ticks in proper places and the
second is plotting each number under it. n is already a list, so you
don't want to put it again on it.
What you are doing with it is to plot under each bar the height of
You are importing pylab again before each plot. You have loaded it before.
for i,t in enumerate(times):
import pylab as pl # <--ERASE THIS
On Wed, Jun 15, 2011 at 12:10 PM, Alain Pascal Frances
wrote:
> Hi,
>
> I have a script that creates and saves figures in a loop. The memory is
>
I can run the script you provided up to 600 without noticing any
memory growth (TkAgg backend by default). Using the WxAgg, the memory
leak appears.
If you don't explicitly need WxAgg, I would recommend using TkAgg, or
better Agg if you are not showing the figures. If it is not the case,
more expe
37 matches
Mail list logo