Rank: 712 based on 218 downloads (last 30 days) and 8 files submitted
photo

John Barber

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by John Barber View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
07 Aug 2012 Screenshot oaxes - central axis lines through an origin Draw central axis lines through an origin point. Author: John Barber graphics, axis, centered axis, central axis, origin, arrow 101 26
  • 4.9
4.9 | 10 ratings
31 May 2012 Screenshot logzplot Easily create surface plots with logarithmic z-axis and color scale. Author: John Barber surface plot, logscaled surface plo..., logscaled plot, logscaled color, logarithmic scaling, log scaled surface pl... 29 4
  • 5.0
5.0 | 3 ratings
06 Jun 2011 Screenshot riemannsphere Plot complex numbers on a Riemann sphere Author: John Barber riemann sphere, complex numbers, complex data, stereographic project..., graphics 16 1
  • 5.0
5.0 | 1 rating
29 Mar 2011 Screenshot obliqueview Obliqueview - View an axes using an oblique projection Author: John Barber graphics, oblique, oblique projection, projection, orthographic projecti..., potw 12 0
29 Mar 2011 Screenshot calcticks Calculate ticks and ticklabels for specified limits, orientation and text size. Author: John Barber ticks, tick, tick labels, ticklabel, axis, graphics 15 1
  • 5.0
5.0 | 1 rating
Comments and Ratings by John Barber View all
Updated File Comments Rating
08 Nov 2014 oaxes - central axis lines through an origin Draw central axis lines through an origin point. Author: John Barber

@Sebastian:
Thanks for the clarification. Yes, that would be an interesting use case. When I get the chance, I'll take a look at how much effort that would take to implement within the existing code.

-John

08 Nov 2014 logzplot Easily create surface plots with logarithmic z-axis and color scale. Author: John Barber

@Cornelis,

Thanks for the feedback. Yes, the changes to the graphics in R2014b introduce some incompatibilities with logzplot(). I hope to have some time to update it for compatibility, but it will probably be a month or two at the earliest.

-John

31 May 2014 oaxes - central axis lines through an origin Draw central axis lines through an origin point. Author: John Barber

@Giuseppe:
1) See my answer and suggested workaround to Felix's question about multiple OAXES. It is not currently possible to have more than one OAXES exist in a given axes. I will consider it for a future release.

2) There is not a way to specify an offset. If you want to show a translated coordinate system, you could simply set the tick labels of the OAXES object to custom values representing the translated coordinates. Be sure to set the tick labels and not the ticks themselves. This trick also works on the standard MATLAB axes object - the tick labels can be independent of the values of the ticks. The drawback is that if the tick locations change (due to limit changes, etc.), the manual tick labels will be incorrect. I'll consider adding an 'offset' property in a future release.

31 May 2014 oaxes - central axis lines through an origin Draw central axis lines through an origin point. Author: John Barber

@Sebastian:
Like many of the low-level MATLAB graphics functions, OAXES does not redraw until the MATLAB event queue is processed, which doesn't necessarily happen when you would like it to during function execution. Instead of using the PAUSE command, you can call the MATLAB function DRAWNOW() (see the help file for DRAWNOW for more information). Alternately, you can force the OAXES object to redraw by calling its DRAW() method. If you have a handle OA to the OAXES, simply call OA.draw(). If you don't have the handle, calling oaxes('draw') should also work as long as it can find the OAXES object.

I'm not sure what you mean by "rotate the axis". In 3D views, the axis lines rotate along with all other drawing objects as the camera location is moved. Trying to keep the displayed axis lines fixed on camera moves means that the lines would no longer correspond to the coordinate system. Although it would be interesting to create a camera-independent display mode for a given object (e.g. apply a transform to the object that undoes the effects of the camera location change), that is not in line with the motivation for writing OAXES.

31 May 2014 oaxes - central axis lines through an origin Draw central axis lines through an origin point. Author: John Barber

@Felix:
(1) I'm not sure what you mean by inside vs. outside the axis. If you are referring to which side of the axis line the labels are drawn on, then there is currently no way to specify this, but I'll consider adding one in the next release. If you are referring to inside and outside of the plot box/cube, OAXES always draws the labels next to the axis lines, which are always inside of the box.

(2) No, it is not currently possible to define minor ticks. They are calculated automatically for log-scale axes, and not shown for linear scaling. This capability might be added in a future release.

(3) It is not possible for more than one OAXES to exist inside of a given axes. If you want to show more than one OAXES on a given plot, you could try overlaying additional axes objects with transparent backgrounds, and limits linked to the original axes, each containing an OAXES object. See the MATLAB functions linkaxes() and linkprop() for more information.

Comments and Ratings on John Barber's Files View all
Updated File Comment by Comments Rating
17 Nov 2014 oaxes - central axis lines through an origin Draw central axis lines through an origin point. Author: John Barber Ameya Sathe

@John,
Perhaps I am missing something obvious, but I am not able to get your package working even with a simple example of a 2D plot that you have provided in the oaxes.m file. I am using Matlab R2014b on a Windows 7 machine, and added the customplots folder using either the Set Path tab in the Home tab, or using addpath(genpath('MyPathOfCustomPlotsFolder')). I get the following error:

Undefined function 'customplots.oaxes' for input arguments of type 'matlab.graphics.axis.Axes'.

Error in oaxes (line 656)
OA = customplots.oaxes(hAx,pvPairs);

Please help!

08 Nov 2014 oaxes - central axis lines through an origin Draw central axis lines through an origin point. Author: John Barber John Barber

@Sebastian:
Thanks for the clarification. Yes, that would be an interesting use case. When I get the chance, I'll take a look at how much effort that would take to implement within the existing code.

-John

08 Nov 2014 logzplot Easily create surface plots with logarithmic z-axis and color scale. Author: John Barber John Barber

@Cornelis,

Thanks for the feedback. Yes, the changes to the graphics in R2014b introduce some incompatibilities with logzplot(). I hope to have some time to update it for compatibility, but it will probably be a month or two at the earliest.

-John

29 Oct 2014 logzplot Easily create surface plots with logarithmic z-axis and color scale. Author: John Barber Cornelis

dear John, thanks for sharing.

Just an observation FYI:
in R2014b I had to make changes in lines 808 and 810 as in this version 'Location' is without any upper Cases :

switch get(hCbar,'Location')
case {'East','West','EastOutside','WestOutside','east','west','eastoutside','westoutside'}
scaleName = 'YScale';
case {'North','South','NorthOutside','SouthOutside','north','south','northoutside','southoutside'}
scaleName = 'XScale';
end

Then still no luck because in:
line 815 >> set(hCbar,scaleName,'log')

Error using matlab.graphics.illustration.ColorBar/set
There is no YScale property on the ColorBar class.

Kind of takes away a/the main feature of your function. Is there anything that can be done to make it r2014b compatible?

01 Oct 2014 oaxes - central axis lines through an origin Draw central axis lines through an origin point. Author: John Barber Sebastian

@John:
what I mean is to create the axis at arbitrary rotation compared to matlab x,y,z directions. For instance, if campos(camtarget + 50/sqrt(3)*[1,1,1]); and then create an oaxis that has for instance x' pointing toward the camera, y' toward the right of the screen and z' is up on the screen. I'm not saying it has to be define compared to the camera position, but some way to rotate it compared to original x,y,z. I agree, in general once it's define, it should remain fixed, such that it corresponds to an actual coordinate system.

Contact us