Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61159404
getPixelsPerData.m
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, May 4, 22:08
Size
1 KB
Mime Type
text/html
Expires
Mon, May 6, 22:08 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17473813
Attached To
rINSTCONTROL Instrument Control
getPixelsPerData.m
View Options
function
pixperdata
=
getPixelsPerData
(
hThis
)
%
GETPIXELSPERDATA
Return
pixel
-
per
-
data
ratio
%
%
Thanks
to
<
a
href
=
"http://www.mathworks.com/matlabcentral/profile/authors/3354683-yaroslav"
>
Yaroslav
Don
</
a
>
for
his
assistance
in
updating
cursorbar
for
%
MATLAB
Graphics
and
for
his
contribution
of
new
functionality
.
%
Copyright
2003
-
2016
The
MathWorks
,
Inc
.
%
Change
Log:
%
13
Feb
2015
:
First
version
posted
on
the
MathWorks
file
exchange
.
%
14
May
2015
:
Added
logarithmic
scale
support
.
hAxes
=
get
(
hThis
,
'
Parent
'
);
%
get
axes
'
limits
xl
=
get
(
hAxes
,
'
XLim
'
);
yl
=
get
(
hAxes
,
'
YLim
'
);
%
get
Axes
'
pixel
position
pixpos
=
getpixelposition
(
hAxes
);
%
assert
proper
scale
switch
[
hAxes
.
XScale
'-'
hAxes
.
YScale
]
case
'
linear
-
linear
'
pixperdata
=
[
pixpos
(
3
)
/
(
xl
(
2
)
-
xl
(
1
)),
pixpos
(
4
)
/
(
yl
(
2
)
-
yl
(
1
))];
case
'
log
-
linear
'
pixperdata
=
[
pixpos
(
3
)
/
log10
(
xl
(
2
)
/
xl
(
1
)),
pixpos
(
4
)
/
(
yl
(
2
)
-
yl
(
1
))];
case
'
linear
-
log
'
pixperdata
=
[
pixpos
(
3
)
/
(
xl
(
2
)
-
xl
(
1
)),
pixpos
(
4
)
/
log10
(
yl
(
2
)
/
yl
(
1
))];
case
'
log
-
log
'
pixperdata
=
[
pixpos
(
3
)
/
log10
(
xl
(
2
)
/
xl
(
1
)),
pixpos
(
4
)
/
log10
(
yl
(
2
)
/
yl
(
1
))];
end
Event Timeline
Log In to Comment