GetDist: 3D plots

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Hiranya Peiris
Posts: 54
Joined: September 28 2004
Affiliation: University College London

GetDist: 3D plots

Post by Hiranya Peiris » June 13 2006

Hello,

I am trying to make a 3D plot with getdist (the 2D plots coloured by a third parameter) and MatLab 7.1. I get the colourbar positioned below the x axis, and the colourbar axis label overwrites the axis label on the x axis. I tried to get the colourbar to be vertical by changing 'horiz' to 'vert' in the matlab script that makes the plot, but this crashes the fix_colorbar script. Does anyone know how to fix this?

Thanks!
Hiranya

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: GetDist: 3D plots

Post by Antony Lewis » June 13 2006

fix_colorbar is supposed to be a workaround for an axis label/colorbar overlap 'feature' of MatLab 7.1 - sent to my by MatLab support. If you change to 'vert' you should be able to delete the reference to fix_colorbar. (If you have an older MatLab version it should work with 'horiz' and not call to fix_colorbar - the problem was only introduced in MatLab quite recently).

Hiranya Peiris
Posts: 54
Joined: September 28 2004
Affiliation: University College London

GetDist: 3D plots

Post by Hiranya Peiris » June 13 2006

Hi Antony,

I will try that - but the MatLab people's fix doesn't work for the horizontal case, at least for me...

Cheers
H

Hiranya Peiris
Posts: 54
Joined: September 28 2004
Affiliation: University College London

GetDist: 3D plots

Post by Hiranya Peiris » June 13 2006

OK I tried commenting out fix_colorbar and changing horiz to vert. Now the colourbar is in the right place, but the colourbar label still appears on the old location overwriting the plot x axis label. Any thoughts?

Thanks
H

Boud Roukema
Posts: 87
Joined: February 24 2005
Affiliation: Institute of Astronomy, Nicolaus Copernicus University
Contact:

Re: GetDist: 3D plots

Post by Boud Roukema » June 16 2006

Hiranya Peiris wrote:OK I tried commenting out fix_colorbar and changing horiz to vert. Now the colourbar is in the right place, but the colourbar label still appears on the old location overwriting the plot x axis label. Any thoughts?

Thanks
H
I don't have an answer to the specific problem, but if you try using the free software equivalent of matlab, called
octave - http://www.octave.org - then you'll join a big community of people working together and have a chance of (legally) fixing the code yourself if there's a problem.

Moreover, you'll be able to contribute your change to the community. Here are the octave discussion lists - they're pretty active, so it's worth trying:

http://www.gnu.org/software/octave/archive.html

Sarah Bridle
Posts: 144
Joined: September 24 2004
Affiliation: University College London (UCL)
Contact:

GetDist: 3D plots

Post by Sarah Bridle » June 16 2006

I did once seriously try to give up matlab and switch to octave. At the time it wasn't actually possible to have a colorbar in octave. A quick google just now didn't uncover any change.

python always seems on the brink of having plotting tools as nice as matlab, but in practice still doesn't seem to be anywhere close yet. matplotlib seems lovely, but as I recall took about 5 minutes to put ~200 points on a plot (cf matlab can do hundreds of thousands in seconds).

I mention this because I am genuinely interested in hearing of something that works well enough (and is free), and hope the above turns out to be wrong.

re the question about the colorbar.
You could edit using the handles of the relevant objects using commands like
kids=get(gcf,'children')
set(kids(1))
get(kids(1))
get(get(kids(1),'ylabel'))
set(get(kids(1),'ylabel'),'string','omegam')
Might need kids(2) etc, or xlabel etc.

Or if looking for a quick fix, could comment out the bit of code that labels the color bar and put some text on at a random position:
text(x,y,'omegam')

Sarah

Hiranya Peiris
Posts: 54
Joined: September 28 2004
Affiliation: University College London

GetDist: 3D plots

Post by Hiranya Peiris » June 16 2006

Hi Sarah,

I hacked the script to put the colourbar in the right place, the tags in the right place, and also overlay 2D contours on the 3D scatter plot. It may be nice to have that in getdist for other people too, so I can email it to Antony if interested. I am a MatLab newbie though, so perhaps the hacks can be implemented more elegantly.

Cheers
Hiranya

Post Reply