Hi Rouben,

I can confirm that it is some scaling/projection issue.

In the meantime, you may be interested in the option combination

\begin{axis}[...,
    scale mode=none,
    scale=0.5,
    ...
]

(without! axis equal).

This will disable most scaling mechanisms, and will use the initial 
orthogonal projection as returned from the 'view' key. I  will look into 
the root cause of the problem.

Best regards

Christian

Am 27.04.2012 16:52, schrieb Rouben Rostamian:
> Thank you, Christian, for looking into this.  For now, I will
> try to achieve a realistic projection by tweaking the individual
> axis scales.
>
> Rouben
>
> ---- original message -------------------------------------------
> From: Christian Feuersänger<cfeuersaen...@googlemail.com>
> Date: Fri, 27 Apr 2012 08:01:51 +0200
> To: Rouben Rostamian<rostam...@umbc.edu>
> Cc: PGFplots mailing list<pgfplots-features@lists.sourceforge.net>
> Subject: Re: Plotting a sphere in pgfplots
>
> Hi Rouben,
>
> thanks for the illustration... you are right; that is certainly unexpected.
>
> It looks like one of the axes (perhaps y?) has a different scale... which
> would mean that the axis equal feature does not what it is supposed to do.
>
> I fear this is a bug a pgfplots (in the axis equal feature). I will look
> into it.
>
> Unfortunately, this means that you have to wait for results. The only
> remaining option would be to customize the scale of the axes manually.
> Pgfplots allows to provide custom (2d projected) axis vectors using
> 'x=...,y=...,z=...' or to scale the default ones (using the post axis scale
> stuff).
>
> Best regards
>
> Christian
>
>
> 2012/4/26 Rouben Rostamian<rostam...@umbc.edu>
>
>> Hi Christian, adding 'axis equal' helps somewhat
>> but the image remains an ellipsoid.
>>
>> An orthogonal projection of a sphere in any direction should
>> look like a circle, shouldn't it?  What I am getting in pgfplots
>> is not a circle.  I have attached a sample image produced by
>> the following code:
>>
>> \documentclass{article}
>> \usepackage{pgfplots}
>> %\usepgfplotslibrary{external}
>> %\tikzexternalize
>> \begin{document}
>> \begin{tikzpicture}
>>         \begin{axis}[view={60}{30}, axis equal=true]
>>          \addplot3[surf, z buffer=sort, domain=0:180, y domain=0:360]
>>                 ({sin(x)*cos(y)},
>>                  {sin(x)*sin(y)},
>>                  {cos(x)}
>>                 );
>>         \end{axis}
>>          \draw (3.45,2.85) circle(1.8);  % for comparison
>> \end{tikzpicture}
>> \end{document}
>>
>> Rouben
>>
>> PS: Changing the view option to `view={45}{0}' produces even
>> a more drastic illustration of the flattening of the sphere.
>>
>> ---- original message -------------------------------------------
>> From: Christian Feuersaenger<cfeuersaen...@googlemail.com>
>> Date: Wed, 25 Apr 2012 20:37:41 +0200
>> To: Rouben Rostamian<rostam...@umbc.edu>, 'PGFplots mailing list'
>>   <pgfplots-features@lists.sourceforge.net>
>> Subject: Re: Plotting a sphere in pgfplots
>>
>> Hi Rouben,
>>
>> the result actually *is* a sphere - but the coordinate system is
>> skewed because the axes do not have the same units.
>>
>> The option 'axis equal' for \begin{axis} will fix it.
>>
>> Best regards
>>
>> Christian
>>
>> Am 24.04.2012 03:58, schrieb Rouben Rostamian:
>>> Hello Christian,
>>>
>>> I have a rather basic question about pgfplots.
>>> I am trying to plot a sphere, like this:
>>>
>>> \documentclass{article}
>>> \usepackage{pgfplots}
>>> \begin{document}
>>> \begin{tikzpicture}
>>>        \begin{axis}[view={60}{30}]
>>>        \addplot3[surf, z buffer=sort, domain=0:180, y domain=0:360]
>>>                ({sin(x)*cos(y)},
>>>                 {sin(x)*sin(y)},
>>>                 {cos(x)}
>>>                );
>>>        \end{axis}
>>> \end{tikzpicture}
>>> \end{document}
>>>
>>> The result appears to be an ellipsoid rather than a sphere.
>>> (I am using pgfplots 1.4.1.)  I suspect that I have failed
>>> to specify an essential parameter.  I searched the manual
>>> but didn't find the necessary information.  Would you please
>>> tell me how to make a sphere that looks like a sphere?
>>>
>>> Rouben
>>>
>>>
>>
>>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Pgfplots-features mailing list
Pgfplots-features@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgfplots-features

Reply via email to