Strange display of 2D axes within panel in new MATLAB version
I’m upgrading from R2017b to R2024a and I’m experiencing strange results in 2D plotting in the new version. See below for examples of the strange results. I’ll provide some information about the code and include some of my observations. I’m hoping someone will recognize what is happening here and know of a solution for it.
I’m making use of the GUI Layout Toolbox. I created two uipanel objects, one for 2D and one for 3D plots, that are children of a uix.VBox object. Each uipanel has only an axes object as child. At any given time, either a 2D or a 3D plot is displayed. To switch from a 3D to a 2D plot, I remove the parent of the 3D uipanel and set the vbox as parent of the 2D uipanel. When plotting something new, I first reset the axes handle and delete its children.
Unfortunately I cannot make a MWE. I tried, but I don’t get the strange results. The cause might therefore be due to the complex implementation of surrounding code, which I cannot fully describe or incorporate in a MWE. However, if you need more specific information, just ask and I can relay my observations.
My observations are the following:
As soon as I interact with the plot, such as zooming or panning, the plot is updated and properly displayed.
The result is consistent for the same content, i.e. if I display a simple sine for a specific interval, I get the same strange result every time. If I change to a cosine, or change the interval, I get a different result.
If I do not do the unparenting/reparenting of the uipanels every time, I do not get a strange result. However, I’d like to keep this because the behaviour is nice, or at least it used to be.
The resetting of the axes handle also seems to play a role. If I place a debugger at the resetting, I see that the plot is as expected, then if I do a step (the resetting) then the plot is messed up, but in a different way than without debugging. I included an example of this as the last image.
After resetting an axes:I’m upgrading from R2017b to R2024a and I’m experiencing strange results in 2D plotting in the new version. See below for examples of the strange results. I’ll provide some information about the code and include some of my observations. I’m hoping someone will recognize what is happening here and know of a solution for it.
I’m making use of the GUI Layout Toolbox. I created two uipanel objects, one for 2D and one for 3D plots, that are children of a uix.VBox object. Each uipanel has only an axes object as child. At any given time, either a 2D or a 3D plot is displayed. To switch from a 3D to a 2D plot, I remove the parent of the 3D uipanel and set the vbox as parent of the 2D uipanel. When plotting something new, I first reset the axes handle and delete its children.
Unfortunately I cannot make a MWE. I tried, but I don’t get the strange results. The cause might therefore be due to the complex implementation of surrounding code, which I cannot fully describe or incorporate in a MWE. However, if you need more specific information, just ask and I can relay my observations.
My observations are the following:
As soon as I interact with the plot, such as zooming or panning, the plot is updated and properly displayed.
The result is consistent for the same content, i.e. if I display a simple sine for a specific interval, I get the same strange result every time. If I change to a cosine, or change the interval, I get a different result.
If I do not do the unparenting/reparenting of the uipanels every time, I do not get a strange result. However, I’d like to keep this because the behaviour is nice, or at least it used to be.
The resetting of the axes handle also seems to play a role. If I place a debugger at the resetting, I see that the plot is as expected, then if I do a step (the resetting) then the plot is messed up, but in a different way than without debugging. I included an example of this as the last image.
After resetting an axes: I’m upgrading from R2017b to R2024a and I’m experiencing strange results in 2D plotting in the new version. See below for examples of the strange results. I’ll provide some information about the code and include some of my observations. I’m hoping someone will recognize what is happening here and know of a solution for it.
I’m making use of the GUI Layout Toolbox. I created two uipanel objects, one for 2D and one for 3D plots, that are children of a uix.VBox object. Each uipanel has only an axes object as child. At any given time, either a 2D or a 3D plot is displayed. To switch from a 3D to a 2D plot, I remove the parent of the 3D uipanel and set the vbox as parent of the 2D uipanel. When plotting something new, I first reset the axes handle and delete its children.
Unfortunately I cannot make a MWE. I tried, but I don’t get the strange results. The cause might therefore be due to the complex implementation of surrounding code, which I cannot fully describe or incorporate in a MWE. However, if you need more specific information, just ask and I can relay my observations.
My observations are the following:
As soon as I interact with the plot, such as zooming or panning, the plot is updated and properly displayed.
The result is consistent for the same content, i.e. if I display a simple sine for a specific interval, I get the same strange result every time. If I change to a cosine, or change the interval, I get a different result.
If I do not do the unparenting/reparenting of the uipanels every time, I do not get a strange result. However, I’d like to keep this because the behaviour is nice, or at least it used to be.
The resetting of the axes handle also seems to play a role. If I place a debugger at the resetting, I see that the plot is as expected, then if I do a step (the resetting) then the plot is messed up, but in a different way than without debugging. I included an example of this as the last image.
After resetting an axes: axes, plot, plotting, figure MATLAB Answers — New Questions