Heatmap creates new windows on each call; only one computer
3 次查看(过去 30 天)
显示 更早的评论
I have a really strange problem. I have matlab installed at both work and at home. At work tonight, I generated a bunch of data, and wrote a very short script to view the data as a heatmap. Each datafile I read is a joint probability distribution and viewing each as a heatmap is helpful. This script just lets me flash through heatmaps, each one replacing the next in the same window upon key press. You can ignore sread5: think of it as a dlmread for my data. A is a matrix.
clear all
for i=0:576
A=sread5('ssatemporal','_JPDF_',i);
heatmap(A,'colormap','winter');
pause
end
However, upon running this exact code at home, the script opens up a new HeatMap object everytime it's called. To be specific, on the first iteration I get a window "Figure 1" which is empty, and a second window "HeatMap 1" which contains my heatmap. This already differs from running it at work, where only a single window opens on the first iteration. Then, on the second iteration, a new figure window opens called "HeatMap 2". Etc. So on iteration 5, I have 6 windows open instead of 1, like when I run this script at work.
To be clear, I have all my includes and scripts saved in a dropbox folder, so when I open a script at home, it's literally the identical file with identical dependencies, etc. This makes me think that the weird windowing problem has something to do with a matlab setting. But I haven't been able to find any such setting that might control this behavior. Thoughts? Thanks in advance for your time.
0 个评论
回答(3 个)
Walter Roberson
2012-8-12
编辑:Walter Roberson
2012-8-12
Check the default settings
get(0,'Default')
Also, are the MATLAB versions the same, and the same 32 vs 64 bits?
per isakson
2012-8-12
编辑:per isakson
2012-8-13
Is this the FEX-contribution that you use?
Customizable Heat Maps by Ameya Deoras
Visualize data as a heatmap with many customizable options.
There are at least two version:
21 Dec 2011
Major update. New features include:
* Text labels correctly update when figure is zoomed, panned or resized
* X tick labels can be rotated
* Show all or a subset of tick labels for large matrices
The signature of this function, heatmap, is
[hImage, hText, hXText] = heatmap(mat, xlab, ylab, textmat, varargin)
With your code I just get an error
Index exceeds matrix dimensions.
Error in heatmap>setAxesLabels (line 280)
set(p.hAxes,'YTick',ytick,'YTickLabel',ylab(ytick));
Set breakpoint at 280
280 set(p.hAxes,'YTick',ytick,'YTickLabel',ylab(ytick));
K>> ylab
ylab =
winter
K>> ytick
ytick =
2 4 6 8 10 12 14
.
Question remains: what heatmap are you running?
.
The handle graphic objects, figure and axes, have a property named, Nextplot (see the code of the function, hold). Could it be that the default values of Nextplot differs between your computers?
Try
get( 0,'defaultFigureNextPlot' )
get( 0,'defaultAxesNextPlot' )
I get (R2012a,64bit)
ans =
add
ans =
replace
.
@Walter, The commamd
get(0,'Default')
doesn't report these values here.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!