3D vector field gnuplot - vector

I'm trying to plot a vector field and i Would like to have some help:
I would like to have a 3D GRID
i would like to know how can i draw a border of specific dimension
How can i define a palette like a gradient based on a specific component of a vector field,
i.e I have a vector field like the one in figure, I'd like the vectors to change color from red to blu depending on the magnitude of the y-component let's say .
I know it's a lot but i really need help
my 3D plot

1) Not sure what you mean by a 3D grid.
2) The border dimensions are set by xrange, yrange, and zrange. You can remove the extra space below the minimum z using
set xyplane 0
To change the size on the page, you can change the 3rd and 4th parameters of the set view command:
set view rotx, rotz, scale1, scale2
It is easiest to adjust these by click-and-drag with the middle mouse button and then either write down the scale values shown in the plot window or issue the show view command.
3) Red to blue palette mapped to y coordinate (column 2 in your plot):
set palette defined (0 "red", 1 "blue")
set style data vector
splot "resampled.odt" using 1:2:3:($4*factor):($5*factor):($6*factor):2 lc palette

Related

Different color points in R

I have the following R-code,
x1=c(3,2,4,1,2,4,4)
x2=c(4,2,4,4,1,3,1)
Y=c("red","red","red","red","blue","blue","blue")
plot(x1,x2,col=Y,pch=8)
grid(NULL,NULL,col="cornsilk2")
legend("right",c("Point","star"),col=c("red","blue"))
That creates a plot as seen below
There are two things that I wish to change however I am not sure how to go about it.
1) I want to change the types of points that appear using the pch feature in plot. So for example, I want the red points to appear as a star and the blue points to appear as a triangle. How would I go about this?
2) I want the legend to show those symbols and be coloured respectively correctly. For example, instead of having "Point" it should be a "." that is coloured blue or red depending on what colour I decide to assign it.
Many thanks for the help.
You specify a vector like your color:
SHAPE = ifelse(Y=="red",8,2)
plot(x1,x2,col=Y,pch=SHAPE)
legend("right",c("Point","star"),col=c("blue","red"),pch=c(2,8))

Changing size of top label when using levelplot for array

I've plottet some data from a 3-dimensional array using levelplot().The 1st&2nd dimension names (dimnames()) are used as tick marks on the x- and y-axis, while the 3rd dimension name is displayed in a light-orange box on top of the graphs. How do I change the size of the text in this box?
Here is what I have so far:
> X<-array(runif(27,1,10),dim=c(3,3,3))
> dimnames(X)<-list(c("yesterday","today","tomorrow"),c(1:3),c("Elephant","Cat","Penguin"))
> levelplot(X)
I want Elephant, Cat and Penguin to be larger. I tried manipulating scales, main.text.cex and even looked into the properties of the plot to find my 3rd-dimension labels in a list called condlevels$Var3.
Because you faceted the plot, it's one of the paramters under strip, so do:
levelplot(X,par.strip.text=list(cex=2))

Gnuplot - Plot graph with continuously varying line color - plot with color fade / transition

I am using GNU plot (gnuplot) to plot some output data from integration of a strange attractor (see Wikipedia) - and as this is a strange attractor the line "rolls around itself in 3D space".
This makes it difficult to see what happens when plotting a lot of data. See this image:
Is there any way to plot a transitioning or fading color from say red at the start to blue at the end? I know gnuplot is a powerful tool but perhaps I ask too much?
I found an answer here: gnuplot
# start value for H
h1 = 117/360.0
# end value for H
h2 = 227/360.0
# creating the palette by specifying H,S,V
set palette model HSV functions (1-gray)*(h2-h1)+h1,1,0.68
splot "output.csv" every 100 using 2:3:4:1 with lines linecolor palette title "Lorenz System"
The 4th argument after using is the color variable to use. In my case this is the time variable. (Col 1)

Show custom values on zgraph

I have plotted a graph using zedgraph library as shown in figure.On x axis zedgraph automatically plotting values between range in our case 1 to 20 its not showing intermediate values i.e. 1,2,3,4....20 I want show point 1,2,3,4,5...20 as well.How can I do that??
MajorStep
Gets or sets the scale step size for this Scale (the increment between labeled axis values).
http://zedgraph.sourceforge.net/documentation/default.html
See Scale Class, scroll down to MajorStep
Or http://www.nudoq.org/#!/Packages/ZedGraph/ZedGraph/Scale/P/MajorStep
.GraphPane.XAxis.Scale.MajorStep = 1;
.GraphPane.XAxis.Scale.MajorStepAuto = false; // Not needed, see documentation.

Create a logarithmic diverging color palette for a treemap in R

I have data that span several orders of magnitude (-10e-9 to 10e+9). I am displaying them on a value treemap, but I want more control over the colors used.
I assume I would want to use the "manual" treemap type, but I have not had much luck with the palette selection / specification. Is there a way to set up a palette in R with the following characteristics?
Diverging, with negative values going from from red (-10e-9) to green (0) and positive values going from yellow (0) to blue (10e+9).
Logarithmic scaling so that the data points closer to zero don't all get assigned nearly-identical colors.
I tried using natural logs of the data for vColor. This produced the visual effect I wanted, but now my legend is displaying log-transformed values, not the original values.
I think you're on the right track. Unfortunately, "manual" treemap assume linear vColor scales.
I will add an argument to change legend break labels. For the time being, you could modify the labels in the plotted grid object.

Resources