Setting current figure in octave - octave

I mean to reuse an already existing figure for adding new plots.
I should make current the figure-to-use.
Is there any difference between
set(0, 'CurrentFigure', f);
and
figure(f);
?

Octave's documentation specifies, for the figure(f) syntax,
If the figure already exists then it is made visible and becomes the current figure for plotting.
That is, besides setting f as the current figure, the command also affects the 'visible' property of the figure f. In a quick experiment (on Linux), it became clear that not only is the figure made visible, but it is also brought to the front and given focus (keyboard input is sent to that figure window). This behavior completely parallels MATLAB's behavior.
Thus, to only change the current figure without affecting visibility or keyboard focus, use set(0, 'CurrentFigure', f).

Related

How to reduce white space in octave legend function

I have build some algorithm and now I should make things pretty enough for presentation. Only problem what I have is a "strange" legend behaviour in octave. I dont know if the problem is because I am using "subplot" function, but I have tried several ideas what was possible to find on google, but none of that really works.
At the uploaded picture we can see that diagram lines names are moved all the way to the left (nothing wrong with that), however there is too much space on the right side of the line names. The legend box is simply too big for the context inside. I have tried already with reducing the size of the font, but is not the best solution.
Can somebody please provide some solution for my problem. My current code status is:
hleg1 = legend({"sample1", "sample2", "sample3"});
set(hleg1, "FontSize", 8);
I currently using Octave version 5.1.0 on windows 10 x64.
The fix for me was te execute the plotting script twice.
The first time you resize the window in full screen mode.
Then you execute the script again (without closing the figure window)
Now legends should not take half the space of your plot ;)

SciChart: How do I control whether rollover axis labels are displayed

I have a chart with multiple modifiers that provide different behaviors on rollover. The chart used to have a vertical line that would show up on rollover. I was asked to get rid of it, which was easy:
<sci:RolloverModifier
DrawVerticalLine="False"
but I noticed that the label that shows up under the X axis is still there. I've tried to remove it, I didn't figure out how to do it.
I've examined some other graphs in the application, and found a similar one, which has the labels showing on both the X and the Y axis
[edit: image removed to prevent potential client IP issues]
I tried comparing the charts, and they do have different sets of modifiers, but I didn't find out what causes one graph to only have the graph on the X axis, and the other one on both.
The property you want is RolloverModifier.ShowAxisLabels.
However, the screenshot you've posted looks like the CursorModifier. If you find out that the CursorModifier is adding the labels then you can either remove this modifier, or you can try a workaround like this one on the SciChart Forums (which is 4 years old so may be out of date!)

Why some actions appear bold in Construct 2?

I am trying to get started with Construct 2 and notice that some actions appear in bold (Visible and Invisible in the screenshot below). What does it mean? Also, it seems like the last one only does so.
PS - It seems that it only happens for events related to buttons (?).
Well I'm not sure about that, but it seems that buttons manipulate the visible/invisible property different, like it's not a native feature.
So I would check the possibility of visible and invisible acting like instance variables for buttons. I will investigate further when I am on my Windows PC and get back to you.

In web audio, what's the difference between using .value(x) and setValueAtTime(x, context.currentTime)?

I am modifying the delayTime audio parameter of a delayNode. I have tried using the value property directly, as in:
delayNode.delayTime.value = x
and also - what I thought was equivalent - the setValueAtTime method with the current time of the context:
delayNode.delayTime.setValueAtTime(x, context.currentTime)
Taking a look at the web audio spec here, I read this in the value section of audio parameters:
The effect of setting this (.value) attribute is equivalent to calling
setValueAtTime() with the current AudioContext's currentTime and the
requested value.
Nonetheless, I noticed that using .value directly causes a big audio glitch, whereas .setValueAtTime is much less noisy. You can hear this in these two jsFiddles by clicking in the button (it's noisy btw):
Change delayTime with .value
Change delayTime with .setValueAtTime
My question is: What is the difference between using the value attribute and using .setValueAtTime with the current time? Why are they different? What causes the glitch to be in one and not the other?
The difference you're hearing is because the Chrome team hasn't removed the dezippering that Chris Rogers originally put into the implementation. Dezippering is a general process of smoothing parameter changes; e.g. instead of actually directly changing the value, you could call setTargetAtTime with a small t; then the value changes smoothly.
For delayTime, this is especially problematic, because any change may cause extreme glitches. (Changes to a gain parameter, for example, MAY cause glitches, but they're likely to be a bit less dramatic.)
Chris' original implementation built dezippering in for all parameters, so that parameter changes would by default be smooth - in short, when you changed .value it wasn't really instantaneously changing the value. However, this causes problems in some parameters (e.g. smoothing the frequency parameter on an oscillator creates a portamento-like effect, which is frequently undesirable). Eventually, after much discussion (https://github.com/WebAudio/web-audio-api/issues/76), the Web Audio Working Group decided that dezippering should not be automatic (you can, after all, always smooth parameters with setTargetAtTime); the Chromium team just needs to remove it from their code. (Apparently Firefox hasn't removed their dezippering either.)
In your particular example, you're making an extreme change to delayTime - a four-second change - and it's getting "smoothed" across a very brief period of time. This is akin to using an analog delay line, and very quickly changing the delayTime. (Check out demos of the Korg Monotron Delay unit, and you'll hear sounds that sound familiar. :) By contrast, the instantaneous change (with setValueAtTime) is just "jumping" - it's probably causing a click, but you don't even hear it by comparison.
So, short story: don't use .value to set the delayTime in this instance, use setTargetAtTime() if you want it to be smoothed, or setValueAtTime() if you want it to be instantaneous. Huge changes to a delayTime parameter, though, are always going to cause some kind of issue; you probably actually want to crossfade between two delay lines or something like that.

Access continuous forms -- how to individualize controls per record?

I have an Access form displaying a tiny amount of data for a certain type of record. Basically it just prints the name on the left and on the right has a bunch of Rectangle controls whose background color I change in the form's OnLoad() function, according to results from a query performed using that record's ID as parameter.
This all worked fine, got my ID/name on the left and 31 boxes on the right, colored if that day of the month is reserved :) But needless to say that function can be completely arbitrary since it's code.
Then I decided to switch to 'continuous form' as to display as many records/items as possible. But alas, it was not to be -- all boxes were colored according to the query/function performed for the first record only. I figured that might be because it's the OnLoad() but changing it to OnCurrent() did not do much either. As it turns out, or that's what I read, the Rectangle intances are shared over the entire form and if I change the BackColor for one of them it changes for that box for each record.
I want to be able to change this according to a query performed on a per-record basis. Is there any way? Up until now I've only been able to find conditional formatting (the feature that's nor available for rectangles nor seems to cater my exact needs?) and kludgy Access 97 text-box hacks.
Thanks in advance :)
You may be coming from an HTML background, where rectangles would be a natural solution. They aren't in Access. I don't think they'll work for you (in fact, "kludgy" could describe the attempt in my humble opinion).
You can however display an image. You'll keep an image for each status ready to call up. I've made visual displays this way. A little later I may be able to post some code, but I think you'll find this plays out pretty simply even if I don't.
ADDED NOTE: I'm glad this looks like it will work for you. You are concerned about "instanced only once" in your comment below. Yes, that's true for rectangles which are unbound controls (because they are designed for mere ornamentation). But you'll be using an image control which is a bound control (see Remou).
Change each rectangle to a text box, Control Source:
=Iif(myConditionIsMet,"ÛÛÛÛÛ","")
The "Û" is the Full Block character in Arial (asc 219).
All unbound controls in a continuous form will be the same; bound controls can be varied using conditional formatting.