Ask Your Question
2

how to get more information on graphics object

asked 2017-10-05 21:28:55 +0100

PatB gravatar image

Hi, I'm plotting arcs, and they're not doing what I want. When I try to examine them the information is hidden behind the message Graphics object consisting of 1 primitive. How do I find out what the arc object contains?

thanks ./pat

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2017-10-06 23:02:01 +0100

slelievre gravatar image

Expanding on @dan_fulea's hint:

sage: A = arc((0, 0), 1, sector=(pi/4, pi/3))
sage: A._objects
[Arc with center (0.0,0.0) radii (1.0,1.0) angle 0.0 inside the sector (0.785398163397,1.0471975512)]
edit flag offensive delete link more
2

answered 2017-10-06 11:02:32 +0100

dan_fulea gravatar image

Please post also some code that constructs the graphic objects. Then potential helpers may give pointed details. Here is some start.

sage: A = arc( (0,0), 1, sector=(pi/4, pi/3) )
sage: print A
Graphics object consisting of 1 graphics primitive
sage: print dir(A)

The print A delivers of course no information. The methods of A are shown using dir. Alternatively, type A. and hit the TAB (possibly twice). Only the public methids are shown. For more hidden methods try A._ and the TAB. (Or double underscore.) My "favorite" way to search the internal representation of a sage object is to ask for its _dict__. Try:

sage: import pprint
sage: pprint.pprint( A.__dict__ )
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-10-05 21:28:55 +0100

Seen: 451 times

Last updated: Oct 06 '17