figure

Change Legend diagram in matlab

♀尐吖头ヾ 提交于 2019-12-25 05:58:08
问题 I have some code that basically does this: for i = 1:length(ReliabilityStruct) if (FailureFlags(i) == 0) plot(X(i), Y(i), '.b'); elseif (FailureFlags(i) == 1) plot(X(i), Y(i), 'or'); elseif (FailureFlags(i) == 2) plot(X(i), Y(i), 'og'); elseif (FailureFlags(i) == 3) plot(X(i), Y(i), 'ok'); else fprintf('\nUnknown Flag, check Data\n') return end end drawnow; legend('Recovery', '1', '2', '3'); So my aim is to make a graph that has different symbols for different flags. See below: As you can see

Computing distance between between 2 point of a 3D figure using datacursor

痞子三分冷 提交于 2019-12-25 01:56:20
问题 I am building a GUI that plot a 3D figure by pressing button. I am trying to return a distance value between 2 points when I select the 2 points using datacursormode on the figure. I know the formula to calculate the distance, but I don't know how to make the data cursor return the (X,Y,Z) value of the 2 points selected. Thanks. 回答1: %// retrieve the data cursor manager for the figure dcm = datacursormode(gcf) ; %// get all the datatips information in a structure dtip_info = dcm.getCursorInfo

(MATLAB) Can I re-plot imported data from axes in GUI to new figure using copyfile?

99封情书 提交于 2019-12-24 15:41:23
问题 Hello I've made a GUI with a button to select a folder containing files and then plot them all on a single axes in the GUI. I've also made a button so that if the user wants to open up this plot in new figure they can. However, for this button, they have to select the same folder again (all I did was include figure; axes; in the same code). But is there a way to save the data that was selected so that they don't have to choose the folder again? I'm thinking of using the copyfile function, but

cross-reference to figure in R Markdown with html output is not working

落花浮王杯 提交于 2019-12-24 11:09:01
问题 I would like to show a nice cross-reference to a picture in the HTML document I'm creating with R Markdown. However, even if I followed the bookdown section on cross-references, I cannot get the reference to show in the final HTML output. I'm working in R Studio, if that helps. .Rmd file: --- title: "ppp" author: "ppp" date: "July 4, 2017" output: html_document: fig_caption: yes --- ```{r setup, include=FALSE} library(knitr) opts_chunk$set(echo = FALSE) ``` ```{r foo, fig.cap="$f_{p}$ as a

Issues plotting multiple plots in a single figure within RMarkdown

 ̄綄美尐妖づ 提交于 2019-12-24 10:35:58
问题 I have plot function that produce four plots like glm. A histogramm, a boxplot and two scatterplots. But I cant put them in the right place in my document so that I can see all informations. I want 2 plots in 1 row and to be wide so I can see all informations like header etc. It's senseless to post my plot function, because it's for a class that I created. My output looks always like this I have the following YAML layout: --- title: author: fontsize: 11 graphics: true documentclass: article

MATLAB: how to save a geoshow figure with faceAlpha?

大憨熊 提交于 2019-12-24 06:04:21
问题 I am trying to save a figure in Matlab R2014a in which I want to plot data over an Image. This is the code: [Singapore, R] = geotiffread(file); s = size(Singapore); matrix = rand(s(1),s(2)); geoshow(Singapore(:,:,1:3), R) hold on geoshow(matrix, R, 'DisplayType', 'texturemap','facealpha',.2); xlim([103.605,104.04]) ylim([1.2,1.475]) This one is the plot that works perfectly: While when I am printing the figure print(gcf, '-dpng', fullfile(FileF, 'test.png')) the image is completely white 回答1:

How to add Greek letter to data cursor in Matlab figure?

巧了我就是萌 提交于 2019-12-24 04:42:05
问题 I added a data cursor in a Matlab figure, and this it the code shown when I clicked "Edit Text Update Function..." function output_txt = myfunction(obj,event_obj) % Display the position of the data cursor % obj Currently not used (empty) % event_obj Handle to event object % output_txt Data cursor text string (string or cell array of strings). pos = get(event_obj,'Position'); output_txt = {['X: ',num2str(pos(1),4)],... ['Y: ',num2str(pos(2),4)]}; % If there is a Z-coordinate in the position,

Knitr Spin and Rmarkdown Fig.cap (figure caption). Producing double numbering pdf document

时光怂恿深爱的人放手 提交于 2019-12-24 04:29:09
问题 I am referring to this Suppress automatic figure numbering in pdf output with r markdown/knitr which I don't think was answered fully. Essentially, I am using knitr::spin and rmarkdown to produce word, pdf and html documents. For word, there appears to be no numbering when one puts in +fig.1, fig.cap = "Figure name" You only get an output Figure name in the caption. To solve that, I used captioner class. figs = captioner("Figure") That works fine for word But I am not faced with rewriting the

Matplotlib figure does not close after being resurrected

烈酒焚心 提交于 2019-12-24 01:57:21
问题 Try the following code: import matplotlib.pyplot as plt fig = plt.figure() #creates a pyplot figure plt.close(fig) #closes the figure fig.show() #resurrects the figure, that is, displays it plt.close(fig) #should close the figure, but does nothing My questions are: why does not the last line of code close the figure ? how to get the figure closed anyway (programmatically) after it has been resurrected as above ? 来源: https://stackoverflow.com/questions/35300855/matplotlib-figure-does-not-close

How can I open two different pylab figures from the same button from a wxpython gui?

喜欢而已 提交于 2019-12-24 00:33:23
问题 I am new to python and I have a serious problem that I cannot overcome. I have created a gui using wxpython that has two text fields and a button. When this button is pressed I call a function that call another function which creates a pie figure according to the input in text boxes. The problem is that if the user do not close the figure and enter new values to the textboxes and press again the button, the program crash instead of showing a second figure. I tried to create different threads