figure

Matlab - updating objects on a plot

◇◆丶佛笑我妖孽 提交于 2019-12-13 05:52:08
问题 I am trying to add a timer a simulation i am working on. At the moment i can get the timer to display in the location i want, however i cant make the numbers clear each other, i.e they all just stack on top of each other slowly creating a solid black mess. I have tried implementing a clf function but it just clears the entire figure. The code for the timer is: HH = 0; MM = 0; SS = 0; timer = sprintf('%02d:%02d:%02d',HH,MM,SS); text(-450,450,timer); %% adjust location of clock in graph using

Remove one of the two legends produced in this Seaborn figure?

佐手、 提交于 2019-12-13 02:55:04
问题 I have just started using seaborn to produce my figures. However I can't seem to remove one of the legends produced here. I am trying to plot two accuracies against each other and draw a line along the diagonal to make it easier to see which has performed better (if anyone has a better way of plotting this data in seaborn - let me know!). The legend I'd like to keep is the one on the left, that shows the different colours for 'N_bands' and different shapes for 'Subject No' ax1 = sns.relplot(y

Saving a matlab figure and keeping all handles

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 02:26:03
问题 I am trying to produce a figure in MATLAB with a popupmenu that changes the axes of a subplot. This works so far. But when saving the figure using File > Save, my handles get deleted and it shows me the following error message: Error using struct2handle Error while evaluating uicontrol CreateFcn Error using handle.handle/set Invalid or deleted object. Error in popup_test/mimi (line 33) set(h1,'XData', [0,8],'YData',[0,8]) Error while evaluating uicontrol Callback It appeares, that when saving

Using multiple colormaps on same axis with ezsurf

老子叫甜甜 提交于 2019-12-13 02:12:00
问题 I'm trying to plot several symbolic functions in the same subplot. Using ezsurf makes it easy to plot symbolic functions, but it doesn't seem to be very configurable. I can't colour the individual graphs (see the figure below). They all automatically take the normal jet colourmap. How can they use different colormaps? edit : Here's the new code I'm running using freezeColors as suggested in the answer: subplot(2,2,4) for i = 1:numClasses f(i) = M_k(i)/sum(M_k); freezeColors hold on ezsurfc(x

Merging two figures in Matlab

一曲冷凌霜 提交于 2019-12-12 19:06:43
问题 I am currently running a Matlab script (below) which produces four seperate graphs. I want to combine two of these graphs so that the are displayed simultaneously. The graphs I wish to combine i referred to as FIGURE 2 and FIGURE 4 in the below script. The only input to the script is a txt file with 6 columns: x coordinates, y-coordinates and 4 variables (Depth [m], Hsig [m] , Period [sec] , Dir [degrees]) Any help on this would be greatly appreciated. % Post-process a SWAN wave model output

Different color for different parts of MATLAB title

穿精又带淫゛_ 提交于 2019-12-12 10:39:09
问题 I have, what I think might be a 'simple' problem. I know how to change the color of a MATLAB title. What I do not know, is how to use two different colors, at two different parts of the title. For example, lets say the title of a figure said "Hello World". Then, I want the "Hello" to be in black, while the "World" to be in blue. How to do this? Thank you. 回答1: You can use TeX markup to do that. Here's an example: title(['Hello {\color{blue}World}']); 回答2: % Create text text('Parent',axes1,...

MATLAB: implay function Changing Options with Code

大憨熊 提交于 2019-12-12 04:23:52
问题 I'm trying to change some implay options before opening the figure. The options I want to change are "Maintain Fit to window" and "range for image pixel intensities" which is at Tools >Colormap . The answer Matlab - implay's default size window is very helpful for beginning. However I am very new at GUI environment in MATLAB. After following the site's instructions, the code is below shows the colormap menu object. close all force implay(zeros(100,100,100)) whole_objs = findall(0); whole_objs

Directly saving a figure to disk without rendering first on the screen

六眼飞鱼酱① 提交于 2019-12-12 01:13:01
问题 I currently have code like the following: import os import numpy as np import pylab import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib.patches import Polygon import numpy as np ... # Read my image img = matplotlib.image.imread(p_image) # Render it, move the coordinates' origin to the upper left corner plt.imshow(np.flipud(img), cmap=cm.Greys_r,origin='upper') # Overlay a polygon p = Polygon( zip(xs,ys), alpha=0.2) plt.gca().add_artist(p) # Save it to disk plt.savefig(p

how to extract data/figure from GUI Matlab?

允我心安 提交于 2019-12-11 16:42:12
问题 I have this matlab GUI (not made by me of course), and I have been looking everywhere for almost about a week on how I can possibly extract the figures from it to no success. I am at my wits end and was wondering if any one could help? I want to be able to copy the figure (and save to desktop to extract data from after), or copy the data in a form of a matrix that I can manipulate and save. I thought I'd put the GUI here in case anyone wants to give it a shot and help (I'd be willing to

No output from ggplot

Deadly 提交于 2019-12-11 15:10:26
问题 Sorry to bother you with what is for sure a very simple mistake, but I still cannot figure it out by myself: library(ggplot2) X = rep(c(1:6),3) Y = rep(c(1:6),3) group = rep(c(1:3), each = 6) data = data.frame(X = X, Y = Y, group = group) ggplot(data, aes(x = X, y = Y, group = group)) + geom_point() I do not get any output from this, no figure is created. What am I doing wrong here? Thanks a lot in advance! Gero 回答1: Try print the plot if you are calling it from another function or in Shiny: