Questions tagged [matlab-hg2]

Handle Graphics 2nd generation. Enables Matlab programmers to customize graphic objects appearance to suit their needs in a more intuitive manner than possible using HG1.

Handle Graphics 2nd generation. Enables Matlab programmers to customize graphic objects appearance to suit their needs in a more intuitive manner than possible using HG1.

33 questions
2
votes
1 answer

MATLAB Errorbars linestyle

When using MATLAB, does anyone know a way for drawing errorbars with the same style of the data line? For example, when using: d = errorbar(x,y,y_error,'Linestyle', ':'); MATLAB returns the data lines in dotted style, while the bars in each of the…
2
votes
1 answer

Side-by-side (instead of overlapping) error bars

I have some data and I am plotting the mean at each time point with error bars showing the standard deviation. I can simply use errorbar(x, y, err) and this works fine for a single line. However, if I want to plot multiple data sets in the same…
farid99
  • 712
  • 2
  • 7
  • 25
2
votes
1 answer

Plot histogram from vector of counts

If I have a vector of histogram edges and bin counts, is it possible to use this to directly generate a histogram plot? For example, given data vectors edges = 0:10; % histogram edges for 9 bins counts = round(normpdf(edges(1:end-1), 5, 2) * 1000) %…
zelanix
  • 3,326
  • 1
  • 25
  • 35
2
votes
1 answer

How to programatically update histogram contents and datatip location? (MATLAB hg2)

I am trying to make an animation where several datasets are being cycled through in a histogram plot, and a datatip follows the highest bar in every frame, as demonstrated below:                            Here's a code which achieves the…
Dev-iL
  • 23,742
  • 7
  • 57
  • 99
2
votes
1 answer

How to properly display TeX strings in axes' datatips? (MATLAB hg2)

I have recently tried to run an old piece of code (written on hg1) on a new version of MATLAB (2015a) that has hg2. I used to be able to do the following (according to the "gnovice-Amro" method): function output_txt = customDatatip(~,event_obj) %…
Dev-iL
  • 23,742
  • 7
  • 57
  • 99
2
votes
0 answers

Matlab - anti-aliased rendering of figure containing plot lines and surf

I'm looking for a way to export anti-aliased graphics containing lines and "surf" at the same time. With HG2, the "plot" lines are anti-aliased by default but the anti-aliasing is switched off once I insert a "surf". The closest I could get was by…
kb_
  • 131
  • 8
2
votes
1 answer

Plot with japanese characters in MATLAB 2014b

MATLAB 2014b is using a new graphic environment (HG2) and I was not able to display japanese characters on my plots. For example the code below does not display the japanese character correctly. I remember to have read before the release that HG2…
oro777
  • 1,110
  • 1
  • 14
  • 29
1
vote
1 answer

What's the complete structure of a figure handle object?

Mathworks has done it again: my ancient R2012 (as bestowed by my company) returns a nice set of doubles identifying the figure window numbers in response to currhandles=findall(0,'type','figure'); Now I got a fellow remotely IM-ing me 'cause the…
Carl Witthoft
  • 20,573
  • 9
  • 43
  • 73
1
vote
1 answer

Matlab Graphics: Jagged Lines in Output

I am facing the issue of poor quality graphics output in Matlab similar to this question but the solutions given there did not work for me. Using either Matlab 2014b or 2015a results in the same issue. Create an example figure with the following…
David Kelley
  • 1,418
  • 3
  • 21
  • 35
1
vote
1 answer

Change legend line style

I am playing with the visual effect of plots, and a question came up while changing the style of a legend. To be able to save the figure with legends big enough that can be seen usually one needs to change the FontSize property to e.g. 24. When you…
Ander Biguri
  • 35,140
  • 11
  • 74
  • 120
1
vote
1 answer

Convert the standard colors from the old colormap to the new one

If I open a previously (before R2014b) saved figure, the colors I used, for instance r, k , ... would appear according to the colormap they have been saved with. What is the fast way to convert the colors to their equivalent colors in the new…
NKN
  • 6,482
  • 6
  • 36
  • 55
1
vote
2 answers

Custom Legend Matlab 2014b

I have a figure where I had some plots trough different functions using hold on. When I want to create my Legend, I don't have access to all the handle of my figures. Is there a way to create an independent Legend by defining the tip of the plot and…
R.Falque
  • 904
  • 8
  • 29
1
vote
1 answer

"Handle to deleted figure" error - Matlab hg2 - Storing a figure handle in a class

I have a class that stores a figure handle. With the new Matlab handle graphics hg2 I get a "handle to deleted figure" error. classdef mytestclass properties hFig = figure end end Creating just one instance of the class works fine,…
poppie
  • 549
  • 5
  • 14
1
vote
1 answer

Issue with Setting Position of Uitable in MATLAB

I am trying to create a uitable in matlab. Consider the following simple example: f = figure; data = rand(3); colnames = {'X-Data', 'Y-Data', 'Z-Data'}; t = uitable(f, 'Data', data, 'ColumnName', colnames, ... 'Position', [20 20…
Mayou
  • 8,498
  • 16
  • 59
  • 98
0
votes
1 answer

How to make the same scale, limit and tick of 2 yaxis left and right in matlab plot

Below is the code that I used to have the same scale for both y axis in MATLAB plot: %% Additions by Dev-iL: date = 1:10; z = 4*randn(3,10); spread = 0.2*sum(z,1); figure(); %% Original code by RSerrano: ax(2) = subplot(2,1,2); % z =…
RSo
  • 17
  • 5