Updating pgfplots

I am using Latex in MacOsx Lion. My current version of pgfplots is 1.4.1 which I want to upgrade to 1.7. I really do not know how to install version 1.7. Any help ?

-
I've retagged with MacTeX assuming that's the one you use. Can you please include all other details about your distribution? – percusse Feb 11 '13 at 19:02
have you seen How do I update my TeX distribution? – cmhughes Feb 11 '13 at 19:51

Mac distribution of LaTeX comes with a little GUI tool called Tex Live Utility that allows you to upgrade packages. You can find it in your Application folder side by side tex editors. Another method is to use terminal command tlmgr in this fashion:

tlmgr update <packagename>

or for updating everything:

tlmgr update --all

To use tlmgr you might need sudo access.

Edit:

Probably you will be prompted to update tlmgr itself. To do so, try

tlmgr update --self
-
Pouya, thank you for your help. I tried (tlmgr update --all) but the message came as follows : pt-sd444:~ subhankardasbakshi\$ tlmgr update --list tlmgr: package repository anorien.csc.warwick.ac.uk/mirrors/CTAN/systems/texlive/tlnet /usr/texbin/tlmgr: The TeX Live versions supported by the repository (2012--2012) do not include the version of the local installation (2011). Goodbye. – subhankar Feb 12 '13 at 15:34
@subhankar, Did you try also with the GUI software? I'm sorry but my latex is up to date so I can't really study this error! Btw I think you have three solutions. 1. To install the latest version of MacTex side-by-side the version that you are using now (or remove the old one and install the latest). 2. Follow the instructions of this link and/or this question. And thirdly, try the solution proposed by zeroth. – Pouya Feb 12 '13 at 16:34

Assuming you are employing the latest TeXlive (MacTeX is built on TeXlive, right?) or similar (MikTeX on windows) it is just a matter of updating with the update tools supplied (see @Pouya answer about TeX-live). However, it could be argued that you needed a more general, switchable solution.

Here is what I do:

I generate some local folder which is named out-of-live/tex. Within that folder you can put a regular TDS structure to comply with regular TeX installations.

In there I put pgfplots and (also pgf as that is typically required to be the lastest CVS version as well).

So I do a local installation of those packages, and others if I like, just there. In general I use CVS and git to be able to update them to the newest state, at any time (thereby going past the TeX-distribution).

Then the folder structure becomes:

.../out-of-live/tex/
pgf/
pgfplots/

Now, you simply need to edit your texmf.cnf file to add this out-of-live to the search path for sources.
Locate your file by: kpsewhich texmf.cnf.
Then edit that file and find the line referring to TEXMFHOME.

Then do this:

TEXMFHOME = {../out-of-live}
% or if it already contains ~/texmf do
TEXMFHOME = {~/texmf,../out-of-live}

TeXlive will automatically assume that that folder contains a TDS compliant directory structure, hence it will look for sources in tex, documentations in doc, etc.
Remember that TEXMFHOME will be searched before the regular installation path.

Also note, that typically by default, TeXlive adds the folder ~/texmf to the search path as well (so you could just place folders pgf and pgfplots in ~/texmf/tex, but the above is a more general picture).

-