plot

MATLAB plot's MarkerIndices property

微笑、不失礼 提交于 2021-02-09 10:54:01
问题 How can I use MarkerIndices with plot ? x = linspace(-10,10,101); y = sin(x); plot(x, y, 'color', 'blue', ... 'LineStyle','-', ... 'Marker', 's', ... 'MarkerIndices', [1, 5, 10], ... 'MarkerEdgeColor', 'black',... 'MarkerFaceColor','yellow'); Error message Error using plot There is no MarkerIndices property on the Line class. Error in plotting3 (line 4) plot(x, y, 'color', 'blue', ... 回答1: MarkerIndices became available in R2016b version. The workaround is plotting two times: MarkerIndices =

MATLAB plot's MarkerIndices property

大兔子大兔子 提交于 2021-02-09 10:53:11
问题 How can I use MarkerIndices with plot ? x = linspace(-10,10,101); y = sin(x); plot(x, y, 'color', 'blue', ... 'LineStyle','-', ... 'Marker', 's', ... 'MarkerIndices', [1, 5, 10], ... 'MarkerEdgeColor', 'black',... 'MarkerFaceColor','yellow'); Error message Error using plot There is no MarkerIndices property on the Line class. Error in plotting3 (line 4) plot(x, y, 'color', 'blue', ... 回答1: MarkerIndices became available in R2016b version. The workaround is plotting two times: MarkerIndices =

How do I get rid of grids when using plot() in R?

血红的双手。 提交于 2021-02-09 09:13:47
问题 So I'm using R to perform a DCA (detrended correspondence analysis) through Vegan package and everytime I plot my results I get a grid in the middle of the plot. I want to get rid of it. Here is my code: dca <- decorana(dados) plot(dca, type = "n", ann = FALSE, origin = TRUE) text(dca, display = "sites") points(dca, display = "species", pch = 21, col="red", bg = "red", cex=0.5) mtext(side = 3, text = "Análise de Correspondência Retificada (DCA)", font=2, line = 2.5, cex=1.8, font.lab=6, cex

R ggplot2 using ..count.. when using facet_grid

半世苍凉 提交于 2021-02-09 08:31:11
问题 I am using R studio in Ubuntu, with standard updated R and ggplot2 I try to create a histogram in ggplot, and to separate the data by groups. I need the plot's y axis to say the frequency of each bin in the subgroup that was split by the facet grid. for example if i have two entries in the data a group 1 1 2 2 I need to use facet_grid to split by group, and then to show that a has one bar for 1 that is 100% percent of the examples in group 1 and vice versa. I found out that the way to do it,

R ggplot2 using ..count.. when using facet_grid

自闭症网瘾萝莉.ら 提交于 2021-02-09 08:29:15
问题 I am using R studio in Ubuntu, with standard updated R and ggplot2 I try to create a histogram in ggplot, and to separate the data by groups. I need the plot's y axis to say the frequency of each bin in the subgroup that was split by the facet grid. for example if i have two entries in the data a group 1 1 2 2 I need to use facet_grid to split by group, and then to show that a has one bar for 1 that is 100% percent of the examples in group 1 and vice versa. I found out that the way to do it,

I have a problem with plotting sphere and a curve on it

旧街凉风 提交于 2021-02-08 23:43:22
问题 I am trying to plot a curve on a sphere but I can not plot them at the same time. I identified some points with Euclidean norm 10 for my curve, and some other points to plot the sphere of radius 10 , respectively as following. Points for curve: random_numbers=[] basevalues=np.linspace(-0.9,0.9,100) for i in range(len(basevalues)): t=random.random() random_numbers.append(t*10) xvalues=[random_numbers[i]*np.cos(basevalues[i]) for i in range(len(basevalues))] yvalues=[random_numbers[i]*np.sin

Matplotlib plots lose transparency when saving as .pdf

淺唱寂寞╮ 提交于 2021-02-08 12:18:58
问题 I'm seeing exactly the same issue as this one: Matplotlib Plots Lose Transparency When Saving as .ps/.eps except I am trying to output to PDF rather than ps/eps. The answers to the previous question point out that eps does not support transparency and suggest either rasterising or saving as a PDF. I do get correct looking output when I save as png, so it seems as though matplotlib is dealing with the transparency correctly, but the backend is failing. Clearly PDF does support transparency, so

Matplotlib plots lose transparency when saving as .pdf

二次信任 提交于 2021-02-08 12:17:08
问题 I'm seeing exactly the same issue as this one: Matplotlib Plots Lose Transparency When Saving as .ps/.eps except I am trying to output to PDF rather than ps/eps. The answers to the previous question point out that eps does not support transparency and suggest either rasterising or saving as a PDF. I do get correct looking output when I save as png, so it seems as though matplotlib is dealing with the transparency correctly, but the backend is failing. Clearly PDF does support transparency, so

Plot the run time of three functions

a 夏天 提交于 2021-02-08 11:41:52
问题 I have three functions doing the same task but in a different way: Function 1: f1 <- function(n) { sum = 0 for(i in 1:n) { sum <- sum + a(i) } return(sum) } Function 2: f4 <- function(n) { sum = 0 for(i in 1:n) { sum <- sum + b(i) } return(sum) } Function 3: f3 <- function(n) { #Done using lgamma sum = 0 for(i in 1:n) { sum = sum + c(i) } return(sum) } I need to plot the runtime of these 3 functions over a range of values 1 - n using user time from system.time . How can this be done in R? 回答1

Python Bokeh Range Does Not Change Upon Update

為{幸葍}努か 提交于 2021-02-08 11:36:57
问题 I'm working with bokeh to generate stock data, whereby the user selects a tickername and start/end dates to generate a graph. However, when selecting certain stocks, the y axis becomes distorted (See my previous question: Bokeh plot becomes distorted when certain stocks are inputted). I've tried to mitigate this by manually setting the y range as the min and max values of a stock upon selection, however, the new range does not update and the y axis does not change. How can I fix this issue?