Try calling legend() again once you've changed the lines; in ipython -
pylab, this
x = linspace(-10, 10, 101)
sub = subplot(111)
plot(x, x**2, label="x^2")
plot(x, x**3, label="x^3")
legend() #Two lines, two legend entries
sub.lines[0].remove() #One line, two legend entries
s
>
>> I am curious though why you prefer to alter the default color cycle
>> rather than just passing the color in to the plot command
[...]
> I got tired of the extra code involved with this method and went
> looking for a way to change the defaults.
I do something similar to enforce style/subs
To put in an argument each way -- I now recognize that the PEP one
gets when looking up "universal newline python" has the necessary
info. I saw but did not recognize over the weekend. So one argument is
that there's no good reason to risk breaking old defaults, mostly
users will be able to
ot_demo2.csv')
soilrec=csv2rec(fh)
print soilrec.dtype
triangleplot_demo.csv
Description: Binary data
triangleplot_demo2.csv
Description: Binary data
thanks!
On Jan 25, 2009, at 1:27 PM, John Hunter wrote:
On Sun, Jan 25, 2009 at 3:23 PM, C Lewis
wrote:
In matplotlib.mlab.csv2r
In matplotlib.mlab.csv2rec in 0.91.2 (*)
headers = reader.next()
fails with "Error: new-line character seen in unquoted field - do you
need to open the file in universal-newline mode?" Which sounds like a
good idea, but I can't figure out how to specify that in/with/before
calling c
olute beginner of matplotlib, can you give me a little
> example of add_current_state_to_plot function? Because I don't know
> the right way to update: do I have to pass all the array, or just the
> new values?
>
> best regards,
> simone
>
> 2009/1/18 C Lewis :
>>
Guessing about what you want:
Does the class change with time? that is, perhaps you have a class
foo, and foo evolves, and you would like to plot a history of some
traits of foo, but at any given moment foo only contains its current
state?
If so, I think you need to have a function in foo,
Someplace to start:
from matplotlib import cm
shade = cm.bone_r
cmstep = shade.N/len(vg_bulk) #TODO: even *more* elegant to space
colors by time elapsed
for ii in range(len(vg_bulk)):
hue = shade(ii*cmstep)
#convert to moles
for iii in (0,1,2):