Re: [sage-support] Re: help with filtering between two lists.

2012-01-03 Thread William Stein
On Jan 3, 2012 3:51 PM, "Volker Braun"  wrote:
>
> Lets face it, constructing a million 2d shapes is always going to be
slow. If you create a PDF then it will be multiple megabytes and it will
stress-test your PDF viewer. Might also be a challenge to print. Not
impossible, but not very handy either. For example, here is a plot that
contains about 120k points that I did a few days ago using matplotlib (that
is, not using Sage's 2d plotting but directly constructing a matplotlib
figure):
>
> http://www.stp.dias.ie/~vbraun/t/points_120k.pdf
>
> Now you want more than an order of magnitude more points.
>
> The only fast way would be to construct a bitmap directly, and avoiding
vector graphics. You can easily find examples of constructing bitmaps from
numpy arrays, say, if you ask Google.
>

The visualize_structure matrix method that Martin Albrecht wrote creates
png's directly.Maybe you can use the method on a sage matrix to somehow
solve your problem?
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: help with filtering between two lists.

2012-01-03 Thread Eric Kangas
I will be printing it out on a plotter D size paper so it should be
big enough.

On Jan 3, 12:51 pm, Volker Braun  wrote:
> Lets face it, constructing a million 2d shapes is always going to be slow.
> If you create a PDF then it will be multiple megabytes and it will
> stress-test your PDF viewer. Might also be a challenge to print. Not
> impossible, but not very handy either. For example, here is a plot that
> contains about 120k points that I did a few days ago using matplotlib (that
> is, not using Sage's 2d plotting but directly constructing a matplotlib
> figure):
>
> http://www.stp.dias.ie/~vbraun/t/points_120k.pdf
>
> Now you want more than an order of magnitude more points.
>
> The only fast way would be to construct a bitmap directly, and avoiding
> vector graphics. You can easily find examples of constructing bitmaps from
> numpy arrays, say, if you ask Google.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: help with filtering between two lists.

2012-01-03 Thread Volker Braun
Lets face it, constructing a million 2d shapes is always going to be slow. 
If you create a PDF then it will be multiple megabytes and it will 
stress-test your PDF viewer. Might also be a challenge to print. Not 
impossible, but not very handy either. For example, here is a plot that 
contains about 120k points that I did a few days ago using matplotlib (that 
is, not using Sage's 2d plotting but directly constructing a matplotlib 
figure):

http://www.stp.dias.ie/~vbraun/t/points_120k.pdf

Now you want more than an order of magnitude more points. 

The only fast way would be to construct a bitmap directly, and avoiding 
vector graphics. You can easily find examples of constructing bitmaps from 
numpy arrays, say, if you ask Google.


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: help with filtering between two lists.

2012-01-03 Thread kcrisman


On Jan 3, 11:43 am, Eric Kangas  wrote:
> well I have 2 million data points, and would like to have each one of
> them a different color.

Wow, I have trouble getting this to show up in a reasonable amount of
time.  2 million is a LOT.

R = rainbow(10^6)

also takes a long time.  What I'd do is something like

L = [(random(),random()) for i in range(10^6)] # random data so it
just fills up the unit square, I'm lazy
sum([point(L[i],color=R[i]) for i in range(10^6)])

but I bet this would take a LONG time.  I'm trying it now and it still
hasn't finished...

In any case, your monitor may not be able to resolve 10^6 colors, and
your eyes almost certainly can't (?).

Does anyone have a sense of what a "reasonable" and *fast* way to do
something like this would be? What are we really looking for here?
- kcrisman

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: coeffs cannot handle a general function

2012-01-03 Thread Michael Orlitzky

On 01/03/2012 12:16 PM, Yi Wang wrote:

Thanks a lot for creating the ticket!

But in 4.7.0 coeffs doesn't work either. Because

sage: f.coeffs(g)
[[g(t)^2 + t + 3*g(t), 0]]

is a wrong result for f = 3*g + g**2 + t. I expect a result [[t, 0],
[3, 1], [1, 2]].

It would be very kind of you to update the ticket about it. I am new
here and I am not sure whether I can edit the ticket myself. Thank you
again!


Oh, sorry, I didn't look very hard at the output, just that it didn't 
throw an error.


I've updated the ticket.

If you're interested, anyone can request an account (instructions are on 
the trac homepage[1]) and that would allow you to create/modify tickets.



[1] http://trac.sagemath.org/sage_trac/

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: coeffs cannot handle a general function

2012-01-03 Thread Yi Wang
Thanks a lot for creating the ticket!

But in 4.7.0 coeffs doesn't work either. Because

sage: f.coeffs(g)
[[g(t)^2 + t + 3*g(t), 0]]

is a wrong result for f = 3*g + g**2 + t. I expect a result [[t, 0],
[3, 1], [1, 2]].

It would be very kind of you to update the ticket about it. I am new
here and I am not sure whether I can edit the ticket myself. Thank you
again!

On Jan 3, 11:23 am, Michael Orlitzky  wrote:
> On 01/03/2012 10:48 AM, Yi Wang wrote:
>
> > Hi,
>
> > I found coeffs does not work with a general function. It would be of
> > great help for me to have it fixed. Thank you!
>
> I created a ticket for this,
>
>    http://trac.sagemath.org/sage_trac/ticket/12255
>
> You should be able to CC yourself and be notified of any progress.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: help with filtering between two lists.

2012-01-03 Thread Eric Kangas
well I have 2 million data points, and would like to have each one of
them a different color.

On Jan 3, 8:39 am, kcrisman  wrote:
> On Jan 3, 11:19 am, Eric Kangas  wrote:
>
> > Also I have been trying to get list_plot to create a rainbow effect,
> > but I am not sure how to go about it. Looked for possible coding and
> > couldn't find any.
>
> Can you be more specific about what you'd like?  We do have the
> rainbow() function for a range of hues, which (perhaps?) would work
> with this...

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: help with filtering between two lists.

2012-01-03 Thread Eric Kangas
well I have 2 million data points, and would like to have each one of
them a different color.

On Jan 3, 8:39 am, kcrisman  wrote:
> On Jan 3, 11:19 am, Eric Kangas  wrote:
>
> > Also I have been trying to get list_plot to create a rainbow effect,
> > but I am not sure how to go about it. Looked for possible coding and
> > couldn't find any.
>
> Can you be more specific about what you'd like?  We do have the
> rainbow() function for a range of hues, which (perhaps?) would work
> with this...

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: help with filtering between two lists.

2012-01-03 Thread Eric Kangas
well I have 2 million data points, and would like to have each one of
them a different color.

On Jan 3, 8:39 am, kcrisman  wrote:
> On Jan 3, 11:19 am, Eric Kangas  wrote:
>
> > Also I have been trying to get list_plot to create a rainbow effect,
> > but I am not sure how to go about it. Looked for possible coding and
> > couldn't find any.
>
> Can you be more specific about what you'd like?  We do have the
> rainbow() function for a range of hues, which (perhaps?) would work
> with this...

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: help with filtering between two lists.

2012-01-03 Thread kcrisman


On Jan 3, 11:19 am, Eric Kangas  wrote:
> Also I have been trying to get list_plot to create a rainbow effect,
> but I am not sure how to go about it. Looked for possible coding and
> couldn't find any.
>

Can you be more specific about what you'd like?  We do have the
rainbow() function for a range of hues, which (perhaps?) would work
with this...

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] coeffs cannot handle a general function

2012-01-03 Thread Michael Orlitzky

On 01/03/2012 10:48 AM, Yi Wang wrote:

Hi,

I found coeffs does not work with a general function. It would be of
great help for me to have it fixed. Thank you!


I created a ticket for this,

  http://trac.sagemath.org/sage_trac/ticket/12255

You should be able to CC yourself and be notified of any progress.

--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: help with filtering between two lists.

2012-01-03 Thread Eric Kangas
Also I have been trying to get list_plot to create a rainbow effect,
but I am not sure how to go about it. Looked for possible coding and
couldn't find any.

On Jan 2, 1:22 pm, Anton Sherwood  wrote:
> On 2012-1-02 09:24, Eric Kangas wrote:
>
> > l1 = [int(x) for x in p]
> > l2 = [int(x) for x in d]
> > l3 = []
> > x = 0
> > for x in l1,l2:
>
> This will give x the values l1 and l2,
> which are not valid indices.
>
>  > if l1[x:x+1]==l2[x:x+1];
>  > l3.insert(x, (x,l1[x:x+1],l2[x:x+1]));
>
> Why ranges (which are lists) rather than simple items?
> Why record two numbers that are always equal (or else unrecorded)?
>
> Is "l3.insert(x, ...)" valid when len(l3) < x?
>
> Others have suggested how to do it with a one-liner.
> Here's better syntax for the 'naive' approach:
>
>         for x in range(min(len(l1),len(l2)):
>                 if l1[x] == l2[x]:
>                         l3.append((x,l1[x]))
>         print l3
>
> --
> Anton Sherwood *\\*www.bendwavy.org*\\*www.zazzle.com/tamfang

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] coeffs cannot handle a general function

2012-01-03 Thread Yi Wang
Hi,

I found coeffs does not work with a general function. It would be of
great help for me to have it fixed. Thank you!

I tested 4.7.0, 4.7.2 and 4.8.0alpha5. None of them work, though 4.7.0
gives slightly different result:

# the following is result of 4.7.2 and 4.8alpha5.
sage: g = function('g', var('t'))
sage: f = 3*g + g**2 + t
sage: f.coeff(g)
3
sage: f.coeffs(g)
---
ValueErrorTraceback (most recent call last)

/home/wangyi/ in ()

/opt/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression.coefficients
(sage/symbolic/expression.cpp:19003)()

/opt/sage/local/lib/python2.6/site-packages/sage/symbolic/ring.so in
sage.symbolic.ring.SymbolicRing.var (sage/symbolic/ring.cpp:6342)()

/opt/sage/local/lib/python2.6/site-packages/sage/symbolic/ring.so in
sage.symbolic.ring.SymbolicRing.var (sage/symbolic/ring.cpp:6069)()

ValueError: The name "g(t)" is not a valid Python identifier.


# the following is the result of 4.7.0
sage: f.coeffs(g)
[[g(t)^2 + t + 3*g(t), 0]]

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: plots in 3d are not published?

2012-01-03 Thread LFS
Thank-you for all the replies! I appreciate all the help.

== 2d plots are generated with jmol in the published worksheets;
== 3d plots are NOT generated.
== (If possible) I want my user/viewer to be able to view the
published worksheet without having to install anything (except be java
enabled).

@kcrisman and William Stein
I tried:

var('x y z')
plane1=implicit_plot3d(x+y==1,(x, -1, 1), (y, -1,1), (z,
-1,1),color='blue', opacity=.3)
plane1.show(viewer='tachyon')

and nothing plotted on my worksheet (or in the published version).
Also - how would I show more than one plot?

Thank-you again, Linda

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org