Page 1 of 1

GetDist: 3D plots

Posted: June 13 2006
by Hiranya Peiris
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

Re: GetDist: 3D plots

Posted: June 13 2006
by Antony Lewis
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).

GetDist: 3D plots

Posted: June 13 2006
by Hiranya Peiris
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

GetDist: 3D plots

Posted: June 13 2006
by Hiranya Peiris
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

Re: GetDist: 3D plots

Posted: June 16 2006
by Boud Roukema
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

GetDist: 3D plots

Posted: June 16 2006
by Sarah Bridle
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

GetDist: 3D plots

Posted: June 16 2006
by Hiranya Peiris
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