On Mon, Feb 13, 2012 at 10:38 AM, Bruce Ford br...@clearscienceinc.comwrote:
I have a application that plots figures on demand. I'm running into an
issue when plotting more than one parameter on a figure. Each parameter is
run through libraries that I've written that make decisions and
Please post a complete (but simple) example that we can easily test.
Doing the *subplot_adjust* will mess up the location of colorbars, but
I believe that colorbars should be still there.
If you're using v1.1 and later, see if using the use_gridspec
parameter works. For example,
On Saturday, January 7, 2012, Jae-Joon Lee lee.j.j...@gmail.com wrote:
Please post a complete (but simple) example that we can easily test.
Doing the *subplot_adjust* will mess up the location of colorbars, but
I believe that colorbars should be still there.
If you're using v1.1 and later, see
On 08/18/2011 09:53 PM, James McMurray wrote:
Hi,
I am having a problem where the colorbar labels will never appear
vertically, even when their rotation is specified as vertical. As you
can see in the screenshot here: http://minus.com/lbOJyOljH this creates
problems when the labels are cut
I made this standalone script here: http://pastebin.com/AnKeCwiU and this
does not suffer from the issue. For comparison here is the plotting function
in my program: http://pastebin.com/7xxtPQYb
The only major difference is the use of the interactive display in the
script, against the use of
After some testing, it appears to be caused by the use of LaTeX in the
labels which then prevents it from being rotated (but only inside the GTK
application). I have no idea why this is only occurring when it is not in
interactive mode, but I guess for the time being I can just try not to use
On 08/18/2011 10:57 PM, James McMurray wrote:
I made this standalone script here: http://pastebin.com/AnKeCwiU and
this does not suffer from the issue. For comparison here is the plotting
function in my program: http://pastebin.com/7xxtPQYb
The problem is that the Gtk backend does not support
On Tue, Jun 14, 2011 at 4:58 AM, Nicholas Devenish
misnomer+matplot...@gmail.com wrote:
Is there a way I can avoid or correct this behaviour? It certainly
seems erroneous that using the figure GUI to adjust plot bounds
doesn't work, and is an especially nice way of tweaking for final
plots.
Unfortunately, ticks in colorbar axes work differently. Use something
like below instead.
cb.formatter.set_scientific(True)
cb.formatter.set_powerlimits((0,4))
cb.update_ticks()
Regards,
-JJ
On Mon, Mar 21, 2011 at 11:26 PM, johanngoetz jgo...@ucla.edu wrote:
Is there a way to set the
Hi All,
Thanks a bunch for your help!
Eric: your suggestion works brilliantly ( I didn't use the interpolation
kwarg though because I like the 'smudged' look). Paul: thanks for your
suggestions but I get errors when trying to execute *
cbar.set_ticks(np.linspace(300,350,6))*. The c.bar.set_ticks
Hi there,
I too want a log scale on the colorbar for an imshow plot. I have tried the
solution proposed by Jae-Joon but I cannot get the ticklabels to show. I
have tried to dynamically change the matplotlibrc settings in ipython using
mpl.rc('text',usetex=True) - where mpl = matplotlib. When I run
On 01/25/2011 06:58 PM, Shrividya Ravi wrote:
[...]
On the same topic of the colorbar, how can I readjust the colors such
that it only goes between user-specified values? For example, I have one
imshow plot where the values range between 0 and 350. However, I only
want to look at the values
Eric Firing, on 2011-01-25 19:52, wrote:
On 01/25/2011 06:58 PM, Shrividya Ravi wrote:
[...]
On the same topic of the colorbar, how can I readjust the colors such
that it only goes between user-specified values? For example, I have one
imshow plot where the values range between 0 and 350.
On 01/25/2011 08:51 PM, Paul Ivanov wrote:
Eric Firing, on 2011-01-25 19:52, wrote:
On 01/25/2011 06:58 PM, Shrividya Ravi wrote:
[...]
On the same topic of the colorbar, how can I readjust the colors such
that it only goes between user-specified values? For example, I have one
imshow plot
Hi Eric,
thanks for your feedback, it helped a lot! I have some questions left,
see below.
2011/1/14 Eric Firing efir...@hawaii.edu:
Quick thoughts with no testing or concrete examples:
1) Don't set the cmap or norm for the colorbar; let it inherit those
properties from the mappable to which
On 01/14/2011 02:02 AM, Daniel Mader wrote:
Hi Eric,
thanks for your feedback, it helped a lot! I have some questions left,
see below.
2011/1/14 Eric Firingefir...@hawaii.edu:
Quick thoughts with no testing or concrete examples:
1) Don't set the cmap or norm for the colorbar; let it inherit
Thank you very much for your patience, your explanations helped me a
very lot in getting beautiful plots for my thesis!
Best regards,
Daniel
--
Protect Your Site and Customers from Malware Attacks
Learn about various
On 01/13/2011 01:40 PM, Daniel Mader wrote:
Hi,
I am trying to plot a set of simulation results of FEM simulations.
With a lot of help from Ben I can plot the deformed shape quite nicely
but I have trouble in applying a colorbar to the plot.
In the attached file there are three results with
On Thu, Nov 18, 2010 at 11:10 PM, John washa...@gmail.com wrote:
1) I only need one colorbar, how would I create a single colorbar on
the right that spanned across all axes? (ie. same height as the stack)
There are a few options you can try. I guess the easiest way is
setting up the axes
On Tue, Sep 28, 2010 at 10:56 PM, Philip Vetter
pv+matplot...@math.duke.edupv%2bmatplot...@math.duke.edu
wrote:
Hello! see below for sample code.
(1) I find that the second subplot is shifted to the right.
This seems to happen generally with colorbar. How do I fix it?
(2) is there a way to
Hi Ben,
Thanks for your reply it sure helps.
My awkward work around until now was to put before the colorbar:
matplotlib.rc('axes',edgecolor='w')
and the return it to
matplotlib.rc('axes',edgecolor='k').
Does some one knows how to increase the distance between the color bar and
the X-axis ?
Now
On Sat, Sep 11, 2010 at 2:10 PM, Oz Nahum nahu...@gmail.com wrote:
Hi Everyone again,
So, with the weekend comes some time to think and I found an answer to
another question of mine.
I know now how to remove xticks in colorbar, and I also know how to
customize the widths of the lines in
On 9/11/2010 3:10 PM, Oz Nahum wrote:
my question, how to remove the axes around the colorbar, or at least changed
the to be non-visible, still stands...
Did you resolve this?
Alan Isaac
--
Start uncovering the many
Hi Everyone again,
So, with the weekend comes some time to think and I found an answer to
another question of mine.
I know now how to remove xticks in colorbar, and I also know how to
customize the widths of the lines in the color bar.
import matplotlib
import numpy as np
import matplotlib.cm
2010/8/20 Bruce Ford br...@clearscienceinc.com:
I have a grid with values ranging from exactly 0.0 and 100.0. When I
plot this with colorbar, the base of the colorbar is labeled -0.0.
Is this a default for 0.0...to plot it with as a negative number? Any
workarounds?
How sure are you that
On 08/20/2010 05:29 AM, Bruce Ford wrote:
I have a grid with values ranging from exactly 0.0 and 100.0. When I
plot this with colorbar, the base of the colorbar is labeled -0.0.
Is this a default for 0.0...to plot it with as a negative number? Any
workarounds?
Would you provide a minimal
This effect is happening within an web app that displays gridded
fields from multiple datasets (~4500 lines of code). So I it's tricky
to create an example. Although if I use numpy.min(grid) the minimum
is 0. So, I think colorbar or matplotlib is interpreting the 0 as -0.
(Matplotlib version
On 08/20/2010 10:14 AM, Bruce Ford wrote:
This effect is happening within an web app that displays gridded
fields from multiple datasets (~4500 lines of code). So I it's tricky
to create an example. Although if I use numpy.min(grid) the minimum
is 0. So, I think colorbar or matplotlib is
Thanks I'll give this a try. numpy.min(grid) reports 0.0 (no
negative) yet it labels as -0.0, BTW, but let me give this a try.
Bruce
---
Bruce W. Ford
Clear Science, Inc.
br...@clearscienceinc.com
http://www.ClearScienceInc.com
On 08/20/2010 10:51 AM, Bruce Ford wrote:
Thanks I'll give this a try. numpy.min(grid) reports 0.0 (no
negative) yet it labels as -0.0, BTW, but let me give this a try.
Bruce,
What matters is not min(grid), but the value of the tick. Unless you are
forcing them to be the same via a kwarg
Hi Friedrich,
thanks a lot, that was exactly what I was looking for...
Alex
On Mon, Jun 28, 2010 at 23:00, Friedrich Romstedt
friedrichromst...@gmail.com wrote:
2010/6/28 Alexander Dietz alexanderdie...@googlemail.com:
I have a plot, to which I am drawing a colorbar. The standard colorbar
2010/6/28 Alexander Dietz alexanderdie...@googlemail.com:
I have a plot, to which I am drawing a colorbar. The standard colorbar
ranges from the values -1 (blue) over 0 (green) to e.g. 1(red). So far so
good.
But now I want to change the colorbar that it shows only the colors between
0 and 1.
Benoit,
Is there any particular reason why you can't do a log10() of the data that
is being pcolor()'d and then label the colorbar as having units of dB? That
would seem to be the most straight-forward approach to me.
Ben Root
2010/6/24 Benoit Donnet benoit.don...@uclouvain.be
Hi guys,
Hello Benjamin,
Thanks for your reply.
Is there any particular reason why you can't do a log10() of the data that is
being pcolor()'d and then label the colorbar as having units of dB? That
would seem to be the most straight-forward approach to me.
That's what I first tested.
In that
Ah, I just noticed that.
Actually, I think I just figured out what is happening. The colorbar
automatically chooses what values to display, and in your case, the values
are 0.0, -0.4, -0.8, -1.2, -1.6, ..., -3.6, which when turned into integers
are 0, 0, 0, -1, -1, ..., -3, which matches what
On 06/24/2010 04:03 AM, Benjamin Root wrote:
Ah, I just noticed that.
Actually, I think I just figured out what is happening. The colorbar
automatically chooses what values to display, and in your case, the
values are 0.0, -0.4, -0.8, -1.2, -1.6, ..., -3.6, which when turned
into integers
Ok, great, it works !
However, I do not understand why latex mode is
disabled by default...
Anyway, thanks a lot,
yves
Jae-Joon Lee wrote:
I'm not sure if the default formatter needs to be changed.
However, you may try
import matplotlib.ticker as ticker
I'm not sure if the default formatter needs to be changed.
However, you may try
import matplotlib.ticker as ticker
formatter=ticker.LogFormatterMathtext()
colorbar(format=formatter)
which will render colorbar ticklabels with mathtext mode.
Regards,
-JJ
On Fri, Apr 16, 2010 at 3:56 AM, Yves
Hi,
I've got two questions:
1) one is related to colorbar() on multiple subfigures (see code example
below): how do I add a scatterplot if I wanted multiple subfigures? Or, what am
I doing wrong in the second code example
2) in either of the examples, how can I increase the distance between the
Try this:
from pylab import *
from numpy import *
Z = random.randn(100,100)
figure()
subplot(1,2,1)
imgHandle = imshow(Z, cmap=cm.gray)
scatter(random.rand(10)*100,random.rand(10)*100)
colorbar(imgHandle)
title('Hello')
show()
By the way, I find jet a bad colormap to represent scientific data:
Jim Vickroy wrote:
Hi,
I have been unable to place a colorbar on the LEFT side of a figure.
For example, in the Gaussian noise with vertical colorbar
http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html
demo, how can the colorbar be positioned on
Colorbar axes is a rather special and things need to be set during the
initialization.
Here is a slightly modified version of your script.
While it does not produces error, I'm not sure if the result is correct.
-JJ
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.dates
@lists.sourceforge.net
*Objet :* Re: [Matplotlib-users] Colorbar embedding in qt4
I isolated the problem a bit more. For some reason drawing gets slower and
slower with each plot drawn.
from os import sys
from time import time
from PyQt4 import QtGui, QtCore
import matplotlib
matplotlib.use
Ok, here is the code as a whole. I think it's still short enough to
ilustrate the problem. Just start it with the datafile elips as an
argument
http://dl.dropbox.com/u/226980/elipsometry.tar.gz
The timer shows how long each render cycle takes. The time seems to grow
with number of cycles
On Sun, Jan 3, 2010 at 11:34 AM, Alexander Hupfer son...@gmail.com wrote:
Hi, I have a scatter plot embedded in qt4 according to
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.html
what works fine
However if I try to add a colorbar to it by simply calling
p =
Hello,
You are using the TK backend.
Add this at the top of your script:
import matplotlib
matplotlib.use('QT4Agg')
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as
FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as
NavigationToolbar
On Sun, Jan 3, 2010 at 5:26 PM, Alexander Hupfer son...@gmail.com wrote:
Ok, that at least fixed the tkinter error, but I still don't get a colorbar
attached to my plot. (which worked fine when I didn't embedd it in a Qt
application)
If you are importing from pylab or pyplot in your program,
Thanks I got it fixed.
This leads to the follow up question:
What is the right way to keep an application responsive while the graph is
drawn?
Drawing a scatter plot with 300 points seems to take a while. I guess I need
to launch the drawing in another thread but don't know exactly how to do
this
Alexander Hupfer wrote:
Thanks I got it fixed.
This leads to the follow up question:
What is the right way to keep an application responsive while the graph
is drawn?
Drawing a scatter plot with 300 points seems to take a while. I guess I
That's strange--a scatter plot with 1000 points
On Sun, Jan 3, 2010 at 7:02 PM, Alexander Hupfer son...@gmail.com wrote:
Thanks I got it fixed.
This leads to the follow up question:
What is the right way to keep an application responsive while the graph is
drawn?
Drawing a scatter plot with 300 points seems to take a while. I guess I need
The api related to ticks and ticklabels is a bit confusing, at least
for me. So, often, it seems best to directly change the tick
properties.
for t in axcbar.xaxis.get_major_ticks():
t.tick1On = True
t.tick2On = True
t.label1On = False
t.label2On = True
-JJ
On Wed, Oct 21,
John,
The following code works for me (Python 2.5.4, Matplotlib 0.99):
# create and format the colorbar
cbar = pl.colorbar(G, ticks=range(g1,g2+1))
cbar.ax.set_ylabel('Gradient (%)', fontsize=10)
cl = pl.getp(cbar.ax, 'ymajorticklabels')
pl.setp(cl, fontsize=10)
-Paul M. Hobson
Thanks Eric for pointing out this. However i've found that psd and
specgram plot 10*log10*(Pxx/max(Pxx)), so i'll have a range from 0 db
down.
Anyway, what do you mean by should not be axes method?
Do you mean using the array output of specgram and psd and plotting that
result by myself?
Cheers
davide lasagna wrote:
Thanks Eric for pointing out this. However i've found that psd and
specgram plot 10*log10*(Pxx/max(Pxx)), so i'll have a range from 0 db
down.
Aha, I wasn't looking closely enough!
Anyway, what do you mean by should not be axes method?
That was a side remark about what
I should perhaps mention, that if i try
cbar=fig.colorbar(p1,orientation='horizontal',ticks=[0.0,2.0,4.0,6.0,8.0])
cbar.ax.set_xticklabels(['0', '2', '4','6','8'])
the colorbar is drawn correctly, but I get the label 0 at position 2, the
label 2 at position 4 and 4 at pos. 6, the labels at the
marcusantonius wrote:
Hello,
I have the problem, that sometimes the first and last ticklabel of a
colorbar is not drawn. E.g. if I create a colorbar through
fig.colorbar(p3,orientation='horizontal',ticks=np.arange(0.0,8,2))
I only get ticklabels at 2,4,6, but I would like it to have
marcusantonius wrote:
I should perhaps mention, that if i try
cbar=fig.colorbar(p1,orientation='horizontal',ticks=[0.0,2.0,4.0,6.0,8.0])
The ticks that it uses are taken from the list--they are the ones that
are within the range of numbers mapped to colors. The list of ticks
does not set
Thank you very much for your email.
Your example
imshow(rand(10,10)*8, vmin=0, vmax=8)
colorbar(ticks=[0,2,4,6,8])
works fine.
Note also that to get the sequence [0,2,4,6,8] you need arange(0,9,2),
not arange(0,8,2). Or you can use linspace(0,8,5) if you prefer.
Thank you for making me aware
On Wed, May 20, 2009 at 9:53 AM, Ryan May rma...@gmail.com wrote:
Thanks for the full example, but if you carefully read the exception, it was
telling you the problem. :) plot1 here is an axes object, which does not
have a colorbar() method. Instead, you should change that to:
On Wed, May 20, 2009 at 10:04 AM, John Hunter jdh2...@gmail.com wrote:
On Wed, May 20, 2009 at 9:53 AM, Ryan May rma...@gmail.com wrote:
Thanks for the full example, but if you carefully read the exception, it
was
telling you the problem. :) plot1 here is an axes object, which does not
P.Romero wrote:
Is it possible to create a colorbar with different scales on each side?
Example:
a temperature colorbar with celcius values on the left side and
farenheit values on the right side.
If so, how could this be done?
A colorbar is just an axes object with some
Michael Outhouse wrote:
I was wondering if it is possible to change the colorbar tick labeling in
matplotlib from numeric to text. Essentially, I want the colorbar to be a
qualitative indicator; in the jet scheme, I'd like blue to be labeled
as 'unstable', green as 'neutral', and red as
2008/11/21 Eric Firing [EMAIL PROTECTED]:
Michael Outhouse wrote:
I was wondering if it is possible to change the colorbar tick labeling in
matplotlib from numeric to text. Essentially, I want the colorbar to be a
qualitative indicator; in the jet scheme, I'd like blue to be labeled
as
stuartornum wrote:
Hi All,
You may remember from my previous post I was having problems plotting a
heatmap, however Pete came through for me and made it work.
Anyway, I have almost finished what I want to do. The only issue is fixing
the colorbar() range limit.
Sometimes the my values are
stuartornum wrote:
Jeff,
That worked perfectly ! Thank you.
One more question... how would I change the colour scheme of the colorbar()?
Thanks again
Stuart: Use the cmap argument to specify a color map.
Have you checked out the pylab examples? For me, they are the best way
to learn
[EMAIL PROTECTED] wrote:
Hello,
I would like to show a colorbar for my plot (see attachment) but I can't
figure out how it works.
In the examples on the website I only found the call to pylab.colorbar(),
which doesn't work with my subplots. My code is as follows (with the bar
graph-part
Bryan Fodness wrote:
Is there a way to get the colorbar to work with an axes instance.
ax2 = axes([0.2, 0.1, 0.6, 0.8], axisbg='w')
ax2.fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r')
ax2.pcolormesh(X, Y, newa, shading='flat', cmap=cm.YlOrRd)#gray_r)
ax2.axvline(x=0, color='gray',
Ryan May wrote:
Yves Revaz wrote:
Hi all,
When I use:
colorbar(orientation='horizontal')
the color bar is drawn on the bottom of the corresponding graph.
Which option will draw the colorbar on the top of the graph ?
I think (correct me if I'm wrong devs) you'll have to use the
Yves Revaz wrote:
Hi all,
When I use:
colorbar(orientation='horizontal')
the color bar is drawn on the bottom of the corresponding graph.
Which option will draw the colorbar on the top of the graph ?
I think (correct me if I'm wrong devs) you'll have to use the cax
keyword argument to
Le Sunday 09 March 2008 14:32:05 Eric Firing, vous avez écrit :
[EMAIL PROTECTED] wrote:
Hello,
I have some stupid questions about how to use colorbar.
1) I would like to be able to put the colorbar where I went: top, bottom,
left, right. For what I see I
[EMAIL PROTECTED] wrote:
Hello,
I have some stupid questions about how to use colorbar.
1) I would like to be able to put the colorbar where I went: top, bottom,
left, right. For what I see I can do only a vertical left and horizontal
bottom ones (with a
Ryan,
See examples/colorbar_only.py. I think it illustrates what you want.
Eric
Ryan May wrote:
Hi,
In working on creating updating pcolor plots, I noticed that I can't
create colorbars (which should be static) without first displaying an
image. I have a fixed Normalize object and
Carol Leger wrote:
Hi folks,
I have encountered a problem using colorbar and set_under with a color
map that has only 32 colors. The downward arrow is not filled with the
correct color. If 64 colors are used, the arrow is filled correctly. I
actually want 8 colors.
The test code is
Sorry, I realise that my example in my original post doesn't quite make
sense. My data range is 17 to 23. I set clim to be clim([15, 25]). I then
want the colorbar limits to be the same as clim, 15 to 25. The questions
remains the same, which is how to set the range for colorbar.
Thanks,
Evan,
It is still not quite clear to me what you want versus what you are
getting. With recent versions of mpl, the colorbar automatically uses
the same color boundaries as contourf, if that is what the colorbar is
tracking. What version of mpl are you using?
(With the most recent mpl I see
Hi Eric
I am using matplotlib-0.90.0.
I am making 2 contourf subplots of temperature values which have similar but
not equal ranges. In subplot1 the range is 15-25; in subplot2 it is 16 to
24. I use clim, giving it the max and min values obtained from a comparison
of subplot1 and 2; i.e., I
George Nurser wrote:
I have been trying to
i. plot a figure using pcolormesh
ii. set the proportions of the figure using ax.set_aspect
iii. draw colorbar
Problem is, colorbar height uses whole of axes box, not just height of
figure (whose proportions were set by call of
77 matches
Mail list logo