I want to draw a straight line using X and Y pixels but my input data is not streamlined. So I tried to draw the line.And it looks like this How should I remove distortion using interpolation or any other techniques.
Actually my problem is This is my expected graph. But I am getting this distorted image with simulation Distorted lines and curves because of uneven pixels. I want to streamline this graph
Related
I am looking for a way to interpolate between lines in a raster. I have a raster file with x and y in GK coordinates and a value for each point on the line:
Plot with lines to interpolate between (I am not yet allowed to add pictures)
Is there a function or a way that allows to only interpolate between the lines? Using interpolate from the Field package does an interpolation everywhere in the raster space, which is not useful for me.
The aim is to have a filled contour between the lines. So something like this: Filled contour between two vertical lines. I am able to do that for a vertical or horizontal combination of lines. But not for any other angles.
I have a three-dimensional vectorfield containing of coherent structures in the form of counter-rotating circles.
I would like to show these structures three-dimensionally.
So far I have used contour() in order to plot the strucutres on the y,z plane as shown in the figure below, where circles of constant magnitude are plotted.
Now I would like to plot these circles three-dimensionally, this would result in the circles being tilted in the direction of the viewer as one can see from the next plot.
How would I be able to plot such three-dimensional strucutres, where the circles are tilted in the direction of the viewer?
Functions as isosurface() do not seem to help.
I would very much appreciate any kind of help.
I have tried various functions such as isosurface(), quiver3() and streamtube() however I am not able to show the plot I am interested in: a single slice of circles being tilted in the direction of the viewer shown in a three-dimensional plot.
I have made the following figure in Octave using the scatter3 function.
I would like to draw the rest of the sides of the cube in the plot (the lines x=0,y=0, z=20,x=0 etc). How to do this?
plot3([0,0],[0,0],[0,20],'linewidth',2,'k')
Draws a line between (0,0,0) and (0,0,20). Make such lines for all the sides.
What I would like to do is make a series of plots that combine an image with a scale that is related to the height of the image, but is multiplied by a factor.
So far I've been able to make a plot using the following code:
library(imager)
im <- load.image("ZAB17_4.png")
plot(im)
Image is attached here
But what I would like to do is to have the y-axis be scaled by a value:
pixel_size <- 0.0596
I would also get rid of the x-axis. (xaxt="n" doesn't seem to do the trick). Ideally, I would like the Y-axis to be directly adjacent to the image. I've been trying to poke around with scales in the plot function, but haven't found what I need to do this, but I'm sure there is a simple solution.
*Edited to add image. I should note that the goal is really just to add a scale to the image. The pixel size represents the size of each pixel in reality in mm. I basically want to add a ruler along the side of the image. Maybe r is not the best tool for this, but I plan to also plot data taken from the imaged object and plot it alongside.
Any help is appreciated.
Sorry if this question has already been answered but I can't find a solution.
I have a data frame which is imported from a .csv file. It has four columns. I want to plot a 3d scatter plot of the first two columns against the last column using Plotly.
The problem is that for some reason, the scatter plot does not automatically resize its axes to fit the plot space. So in this case I end up with a tall thin plot. The weird thing is that if I do an example with some random numbers, I don't get this problem.
Can anyone help me to get my scatter plot to fit to the window?
My data can be found at https://www.dropbox.com/s/ojwrezjker33x2b/Data.csv?dl=0
Basically I want to do:
library(plotly)
X<-read.csv("Data.csv")
plot_ly(x=X[,1],y=X[,2],z=X[,4],type='scatter3d',mode='markers')
And this results in a tall and thin scatter plot (sorry can't post an image cos I am new to the site).
I would like this to be a well-proportioned scatter plot that fits the window.
Thanks for any help.
The default setting for aspectmode is 'auto' and Plotly will try to keep the relative axis lenghts equal.
If you set aspectmode='cube' you should get a plot with identical absolute axes lengths.
plot_ly(x=X[,1],y=X[,2],z=X[,4],type='scatter3d',mode='markers') %>%
layout(scene=list(aspectmode='cube'))