Hi Paul,
thanks for your efforts, I've figured it out by myself by now, with you
pieces of code:
ax1.grid()
ax2.grid()
ax1.xaxis.grid(False)
does the trick :)
--
This SF.net email is sponsored by Windows:
Build for
ah, should have been:
ax1.grid()
ax2.grid()
ax1.yaxis.grid(False)
--
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev___
Hi,
I need a twinx() plot with horizontal and vertical grid lines for the
second axis, just like the usual grid for the first axis. I don't need or
want to specify the ticks manually, though!
My example code just produces horizontal lines:
import pylab
datax = pylab.arange(50)
data1 =
Hi Paul,
I've modified your suggestion a little, since I don't want a grid for the
primary axis at all -- unfortunately to no avail, i.e. no grid line at all:
import numpy
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
datax = numpy.arange(50)
data1 =
Hi,
why don't you just parse the returned string?
asdf = '3:04:02.994000'
asdf = asdf.split(':')
temp = asdf[-1].split('.')
print asdf
asdf.pop(-1)
print asdf
asdf.extend(temp)
print asdf
asdf = [int(i) for i in asdf]
print asdf
hrs,mins,secs,usecs = asdf
That should work, and you can always
Hi,
this is a known problem when working with subplots, reducing the
figure size or increasing the font size. It is like that by design but
there are workarounds.
http://old.nabble.com/Feature-request%3A-automatic-scaling-of-subplots,-margins,-etc-td31556961.html
Yes, it is a known problem, and it is by design. However, the OP has a good
point that the gallary should have nice-looking plots. Therefore, it would
make sense to modify those really bad examples with subplot_adjust() to
allow them to look better.
Very much agreed :)
Hi Karthik,
I cannot find any problem with your code. You are mixing modules a little
too much to my taste but it's not a technical problem.
Loading and saving the data works flawless here. Attached is an infile and a
modified script, please try this.
2011/6/11 Karthikraja Velmurugan
Hi,
try putting an r in front of your string:
e.g. label=r'äöü߀'
And it might help to tell your editor the used encoding, too, by
putting this as the first line:
# -*- coding: utf-8 -*-
Hope this helps,
Daniel
2011/6/9 Klonuo Umom klo...@gmail.com:
Hi,
How can I use font in my locale or
Hi,
I just noticed this doesn't work here, too, as I expected :(
with u'äöüß°€' I can print the string, but the labels are still broken
in the plot:
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
xlabel = r'öäüß°€'
plt.xlabel(xlabel)
plt.show()
plt.savefig('asdf')
I also use LaTeX with utf8 input encoding (and imho the required
preamble is fully OK since it is 100% LaTeX) when generating PDF
graphics -- but I do that only on a Linux box, so I can't verify for
Windows...
2011/6/9 Klonuo Umom klo...@gmail.com:
AFAIK I used this when working LaTeX in UTF-8:
for clarification!
2011/6/9 Stan West stan.w...@nrl.navy.mil:
From: Daniel Mader [mailto:danielstefanma...@googlemail.com]
Sent: Thursday, June 09, 2011 11:59
Hi,
I just noticed this doesn't work here, too, as I expected :(
with u'äöüß°€' I can print the string, but the labels are still broken
in the plot
, 0.02])
fig.colorbar(im2, cax, orientation='horizontal')
Ideally, I'd need to create a new subfig 313 with a much reduced height.
Either way, you helped me a lot!
2011/6/7 Eric Firing efir...@hawaii.edu:
On 06/07/2011 01:37 AM, Daniel Mader wrote:
Hi Eric,
2011/6/6 Eric Firingefir
Hi Eric,
2011/6/6 Eric Firing efir...@hawaii.edu:
It's not quite clear to me yet, but I assume you want to use a call to
imshow with a different data set in the second subplot, but have the
color scale and colorbar be identical to those in the first subplot. Is
that correct? If so, all you
='#', delimiter=';')
v1 = [0,98760,0,1]
v2 = [0,98760,-2,2]
plt.figure(1)
plt.subplot(2,1,1)
print 'loading', datafile1
plt.axis(v2)
plt.plot(a1, 'r.')
plt.subplot(2,1,2)
print 'loading', datafile2
plt.axis(v1)
plt.plot(b1, 'b.')
plt.show()
2011/5/30 Daniel Mader danielstefanma
Hi,
the content of the CSV is stored as an array after reading. You can
simply access rows and columns like in Matlab:
firstrow = a1[0]
firstcol = a1.T[0]
The .T transposes the array.
The second element of the third row would be
elem32 = a1[2][1]
which is equivalent to
elem32 = a1[2,1]
A
Hi,
firstly, I do not fully understand why you have chosen such a complicated
solution to a rather simple problem. If the data in your file really is like
the example then you could simply put the file 'ch1.csv' into the same
directory as your Python script.
I have slightly modified it (I don't
Lee lee.j.j...@gmail.com:
On Fri, May 6, 2011 at 5:20 PM, Daniel Mader
danielstefanma...@googlemail.com wrote:
From many postings here I have learned that
this is the absolute intention, i.e. it is broken by design unless the
programmer takes care about this.
I think there are pros and cons
Hi again,
Hi Jae-Loon,
thanks for your comments! Of course I do agree that a figure layout
should not change in interactive mode. However, I don't see why this
should happen upon a panning action. A different case is when the
label or title font sizes are changed, but I was assuming this is
Hi, I like this, too.
However, I don't understand why it works at all. Usually, when I apply
a colormap, I need to take care about the scaling myself, i.e. divide
the range up into the number of elements to plot:
import pylab as pl
import matplotlib.cm as cm
xval = pl.arange(0, 20, 0.2)
n = 256
Hi,
almost every time I create a somewhat more complex figure I have to
fight with the not too smart positioning of the plots and the size of
margins around the axes. From many postings here I have learned that
this is the absolute intention, i.e. it is broken by design unless the
programmer
Very nice, will try this asap!
Many thanks!
2011/5/6 Tony Yu tsy...@gmail.com:
On Fri, May 6, 2011 at 5:55 AM, Chris Rodgers chris.rodg...@berkeley.edu
wrote:
The real solution of course is to calculate exactly where every piece
of text actually is, detect overlaps, and adjust. That is
/2.))
ax2.figure.canvas.draw()
ax1.callbacks.connect(ylim_changed, update_ax2)
ax1.ticklabel_format(useOffset=False, axis='y')
##--
pylab.show()
2011/3/10 Daniel Mader danielstefanma...@googlemail.com:
Hi Ben
:
On 03/10/2011 01:13 AM, Daniel Mader wrote:
Maybe I should mention that there are actually two reasons why I don't
like this behavior:
1) it's sometimes very hard to read what's going on,
2) there also seems to be a bug when the limits are changed later, see
attached results: the upper
Hi Ben,
thanks a lot, this really helpes in the simple example, I'll try to
find out how to use it in the complex script. It seems 1.0.0 is recent
enough for this!
Thanks again,
Daniel
2011/3/10 Benjamin Root ben.r...@ou.edu:
On Thu, Mar 10, 2011 at 4:54 AM, Daniel Mader
danielstefanma
Hi,
have you tried to print the EPS without putting it into a DOC? Is
there a specific reason for why you don't use an PNG for that task?
Can Word print EPS at all?
Best,
Daniel
2011/3/1 Zhaoru Zhang zhaoruzh...@gmail.com:
Hi,
I created an eps figure file with matplotlib. I can look at it
I have slightly modified the example from
http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels
in order to demonstrate what I mean.
It works with the manual string tick labels but not with regular
auto-generated numerical ones.
Maybe someone knows how to
There is the one in the code, as suggested on the FAQ site :)
thanks for pointing out the rcParams solution! For the time being,
this seems an OK approach. I'd like to use the automatic solution,
though
There isn't one.
Hi,
there has been a similar question recently but I couldn't figure out
if or how this is solved:
I'd like to reduce the figure size so that I can add it to a LaTeX
document without scaling (PDF output with LaTeX font rendering). For
that, I need to adapt the font sizes, too.
Unfortunately,
Hi Waléria,
in order to test it and help you without spending too much time on it,
could you please provide a stripped example which runs standalone?
As a general rule you should set limits at the very end of the
plotting code in order to prevent them from being superseded by
another command!
Hi Waléria,
you should try to figure out the docstring help :)
In a terminal (IDLE or IPython), just do
import matplotlib
matplotlib.errobar?
This will show you extensive help on the command.
You will also need to compare with the regular plot command:
matplotlib.plot?
Best regards,
Daniel
Hi,
I am trying to add a (configurable) colorbar to a an array which I simply
plot with imshow().
Could anyone please help me how to enhance it with a colorbar?
import scipy,pylab
import matplotlib.cm as cm # colormaps
import matplotlib.colors as col # colormaps
dat =
Thanks a lot Thomas,
besides that it should be
fig.colorbar(im)
instead of
ax.colorbar(im)
the example works great!
Best regards,
Daniel
2011/2/7 Eric Firing
On 02/07/2011 10:48 AM, Daniel Mader wrote:
Hi,
I am trying to add a (configurable) colorbar to a an array which I
simply
Hi, I'd very much vote for such a feature, too. It's absolutely not
foolproof currently the way it is :(
What I find weird, too, is that while everthing fits on the canvas for PDF
output, the left side is cropped for PNG.
´
Best regards,
Daniel
2011/2/1 Paul Anton Letnes wrote:
On 10. juni
Dear Paul,
thank you very much for the quick reply! Unfortunately, I don't seem to get
things right with your snippet of code:
# prevent the automatic rotation caused by view changes
ax.yaxis.set_rotate_label(False)
ax.yaxis.label.set_rotation(45)
Traceback (most recent call last):
File
Ah, thank you very much, that helped! It works nicely!
Best regards,
Daniel
--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better
Hi,
I need to create a huge range of plots with need to fit into a report
(OpenOffice or Word). In order to save the work of manual resizing them when
dragged and dropped, I wanted to preset a correct figure size with a nice
resolution:
pylab.rcParams['figure.figsize'] = 5,4
Hi,
for my thesis I have a large number of plots generated
by--again--a laaarge number of Python scripts.
Now I need a moderate font size for all of them for the thesis while
for a presentation and poster it needs to be much bigger.
In order to keep track of all the plots and files I
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
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
Dear Ben,
again, thanks for all your support! Still, I am unable to get the plot
done. In your example, each set of elements gets a color where as I
need each element to have its own color.
I'll attach a file to demonstrate. Maybe you know how to get this
done, and sorry that I am a bit slow on
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 different results.
How can I apply a global
Hi,
the same happens with regular colorbars, too. Me, too, I didn't
always have this issue but I can't tell when exactly it was
introduced. Looks more like a bug than a feature to me---at least on
screen the result looks ugly.
Best regards,
Daniel
2011/1/12 warm...@web.de:
Hi,
I used the
Um, after seriously playing with the file I realized that the
suggested workaround of generating a closed single polygon won't work
for me: I need the individual quads or triangles in the plot as they
correspond to FEM simulation elements and have stress values assigned
to them...
As far as I
Interesting... this will need to be investigated a little bit further. In
the meantime, making a single polycollection with all the pieces seem to do
the trick for now. I have attached a modified version of your script to
demonstrate.
Dear Ben,
this is great news, it works perfectly well!
attachments.
Again, any help is deeply appreciated!
Best regards, Daniel
2011/1/8 Benjamin Root ben.r...@ou.edu:
On Sat, Jan 8, 2011 at 4:07 PM, Daniel Mader
danielstefanma...@googlemail.com wrote:
Hello,
I have a problem with the 3D plotting of PolyCollections with
python-matplotlib-1.0.0
Hello,
I have a problem with the 3D plotting of PolyCollections with
python-matplotlib-1.0.0 (on openSUSE 11.3 x86_64):
instead of being correctly stacked as in the example
http://matplotlib.sourceforge.net/examples/mplot3d/polys3d_demo.html,
the plots are weirdly overlapping. The example works
47 matches
Mail list logo