0

this is my second question on this topic. This is the previous question, which I didn't specify correctly. Let's suppose I have a data:

x=[-10^-3,-10^-2,-10^-1,0,10^-3,10^-2,10^-1]
y=[-10^-3,-10^-2,-10^-1,0,10^-3,10^-2,10^-1]

My goal is to plot this in loglog scale. The result should be similar to plot(x,y), but both axes must be in logarithmic scale. I want y-axis to contain both negative and positive values, and be in logarithmic scale.

This doesn't solve my problem, as long as negative y-values are ommited:

plot(x,y)
set(gca, 'XScale', 'log')  
set(gca, 'YScale', 'log')

The simple solution would be to plot negative values as possitive, but with different symbols/color. But I want to have a nice loglog plot with both negative and positive values of y.

As far as I understood, there is no tools to do this in Matlab rightaway, so I am going to develop my own function to plot it. Does anyone know usefull commands, that can be used to do this? Is that possible to do it with a few build-in commands, or the only way is to create a programm, starting from the basics?

The image is attached. enter image description here

I would appreciate any hints or codes.

Edit: in this question the problem is solved for semilog plot. My problem is loglog

Thanks.

Community
  • 1
  • 1
Mikhail Genkin
  • 3,247
  • 4
  • 27
  • 47
  • Why did you ask a new question instead of clarifying your old question? This is now a duplicate of [Plotting in logarithm scale (Matlab)](http://stackoverflow.com/q/32723195/1552737). – IKavanagh Sep 22 '15 at 19:37
  • Just because old one was not so specific. The answers were given, but now I formulated a new one correctly. – Mikhail Genkin Sep 22 '15 at 19:59
  • And the solution given here: http://stackoverflow.com/questions/21027269/positive-negitive-log10-scale-y-axis-in-matlab – Mikhail Genkin Sep 22 '15 at 20:00

0 Answers0