Henry Walton was a world-renowned psychiatrist and art collector.
He died in July, aged 88, having built up a massive private collection with his late wife, the renowned child psychiatrist Sula Walton.
Their collection ranged from early Chinese pottery to Picasso and Rembrandt prints.
Mrs Walton died aged 85 in September 2009.
The Waltons were well known in Edinburgh and further afield and regularly hosted parties at their home in the capital.
The walls of their home were adorned with 300 paintings, with most later given to the Scottish National Gallery of Modern Art for display.
Mr Walton's published will has now revealed the extent of the couple's generosity to art and cultural institutions in Scotland.
He left orders for a trust fund to be set up to support and buy works of art for the Scottish National Museum of Modern Art in Edinburgh, asking that the first purchase be acknowledged as having been gifted from himself and his wife.
The Royal Museum of Scotland has been allowed to choose any items of the Waltons' African or Oriental art works to hold on display, and the National Gallery has been gifted any artworks in the collection made before 1900.
The Waltons' total estate was valued at £5,277,764.42 and included a large stocks and shares portfolio worth more than £2.1m. Their extensive art collection – including a £200,000 Picasso and works by Paul Cezanne, Goya, George Braque, and David Hockney – was valued at over £1.8m.
Their investments included £58,000 in Scots firm Aggreko and £75,000 in drinks giant Diageo.
Born in South Africa, Mr Walton studied medicine at the University of Cape Town, where he spent the holidays painting and contemplating which interest to pursue as a career.
Medicine won and he qualified in 1945, later training in neurology and psychiatry before being invited to the UK as a senior registrar at the Maudsley Hospital in London in the mid-1950s. There he met Dr Sula Wolff and the couple married in 1957.
He returned to South Africa as head of Cape Town University's department of psychiatry, but by 1962 he was a senior lecturer in psychiatry at Edinburgh University, where he became professor until 1985.
In 1986, he was appointed professor of international medical education by Edinburgh University and travelled the world lecturing, presiding at medical education conferences and working closely with bodies including the World Health Organisation, United Nations Educational Scientific and Cultural Organisation and the World Bank. He was a founder of the UK's Society for Research in Higher Education and chaired its council in the 1970s.
He held honorary doctorates from numerous universities, edited the journal Medical Education for many years, wrote or co-authored various reports and books including the best-selling paperback Alcoholism.
Mr Walton became a driving force behind Paintings in Hospitals Scotland, now Art in Healthcare, and was the founding chairman of Art and Disability Scotland.
A National Galleries of Scotland spokeswoman said: "We are delighted to be receiving a major gift from the estate of the late Professor Henry Walton.
"The Galleries will also be the beneficiaries of the Henry and Sula Walton Fund. The intention of the fund is to benefit the arts, through the purchase and display of works of art for the Scottish National Gallery of Modern Art."