Dear all, I would like to overplot a line to a slice of mine. I use the line callback, for example with the following sintax: p.modify["line"]((0,639),(30,30)) if I have well understood, the two pairs of numbers are pixel-based coordinates. I have a few questions: 1) where is the range of these number set (i.e., the image size in pixel), and how can I eventually modify it? 2) Is it any simple way to define the begin and end points of a line in other coordinates? Code coordinates from 0 to 1 would be enough; 3) How do I modify the features of the line (e.g. thickness, color)? Thanks in advance, Luigi -- --------------------------------------------------------------- Luigi Iapichino Zentrum für Astronomie der Universität Heidelberg Institut für Theoretische Astrophysik Albert-Ueberle-Str. 2, D-69120 Heidelberg, Germany Tel: +49 6221 548983, Fax: +49 6221 544221 e-mail: luigi@uni-heidelberg.de URL: http://www.ita.uni-heidelberg.de/~luigi/
Hi Luigi,
On Tue, Aug 23, 2011 at 5:15 AM, Luigi Iapichino
Dear all,
I would like to overplot a line to a slice of mine. I use the line callback, for example with the following sintax:
p.modify["line"]((0,639),(30,30))
if I have well understood, the two pairs of numbers are pixel-based coordinates. I have a few questions:
1) where is the range of these number set (i.e., the image size in pixel), and how can I eventually modify it?
It's usually set in the figure creation.
2) Is it any simple way to define the begin and end points of a line in other coordinates? Code coordinates from 0 to 1 would be enough;
Yup, use the 'image_line' callback instead. (We really need a better documentation system for the callbacks!)
3) How do I modify the features of the line (e.g. thickness, color)?
You can supply a dict as the keyword plot_args, which will get passed to matplotlib's 'plot' command. So any arguments can be supplied to that. i.e., p.modify["image_line"]((0.1,0.3), (0.4,0.5), plot_args={'c':'b', 'lw':2.5}) This sets color to blue, linewidth to 2.5. -Matt
Thanks in advance,
Luigi
--
---------------------------------------------------------------
Luigi Iapichino Zentrum für Astronomie der Universität Heidelberg Institut für Theoretische Astrophysik Albert-Ueberle-Str. 2, D-69120 Heidelberg, Germany Tel: +49 6221 548983, Fax: +49 6221 544221 e-mail: luigi@uni-heidelberg.de URL: http://www.ita.uni-heidelberg.de/~luigi/ _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Thanks Matt, this is exactly what I was looking for! Cheers, Luigi On Tuesday 23 August 2011, Matthew Turk wrote:
Hi Luigi,
On Tue, Aug 23, 2011 at 5:15 AM, Luigi Iapichino
wrote: Dear all,
I would like to overplot a line to a slice of mine. I use the line callback, for example with the following sintax:
p.modify["line"]((0,639),(30,30))
if I have well understood, the two pairs of numbers are pixel-based coordinates. I have a few questions:
1) where is the range of these number set (i.e., the image size in pixel), and how can I eventually modify it?
It's usually set in the figure creation.
2) Is it any simple way to define the begin and end points of a line in other coordinates? Code coordinates from 0 to 1 would be enough;
Yup, use the 'image_line' callback instead. (We really need a better documentation system for the callbacks!)
3) How do I modify the features of the line (e.g. thickness, color)?
You can supply a dict as the keyword plot_args, which will get passed to matplotlib's 'plot' command. So any arguments can be supplied to that. i.e.,
p.modify["image_line"]((0.1,0.3), (0.4,0.5), plot_args={'c':'b', 'lw':2.5})
This sets color to blue, linewidth to 2.5.
-Matt
Thanks in advance,
Luigi
--
---------------------------------------------------------------
Luigi Iapichino Zentrum für Astronomie der Universität Heidelberg Institut für Theoretische Astrophysik Albert-Ueberle-Str. 2, D-69120 Heidelberg, Germany Tel: +49 6221 548983, Fax: +49 6221 544221 e-mail: luigi@uni-heidelberg.de URL: http://www.ita.uni-heidelberg.de/~luigi/ _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- --------------------------------------------------------------- Luigi Iapichino Zentrum für Astronomie der Universität Heidelberg Institut für Theoretische Astrophysik Albert-Ueberle-Str. 2, D-69120 Heidelberg, Germany Tel: +49 6221 548983, Fax: +49 6221 544221 e-mail: luigi@uni-heidelberg.de URL: http://www.ita.uni-heidelberg.de/~luigi/
participants (2)
-
Luigi Iapichino
-
Matthew Turk