Is it possible to change gnuplot polar axes default range from 0-360 to -180 to 180 - range

Gnuplot default range for polar coordinates is 0-360. Is it possible to change this default, and if so where?

Polar coordinates are interpreted as [t;r]. The default range of the independent variable t (trange) is [0:2pi], or if you have previously said set angle degrees then trange defaults to [0:360]. The default is just that, a default. You can set the range to anything you like before plotting. If you want tic labels for t and r you may need to set the tic range to match. If you plan to use these same settings for many plots, you might put some subset of the preparatory commands in your ~/.gnuplot startup file or in a configuration file that can be loaded prior to plotting load "polar_layout.gp"; plot t
set polar
set angle degrees
set trange [-180:180]
# turn off x/y border and labels
unset border; unset tics
# turn on polar border and axis labels as needed
set border polar
set grid polar
set ttics -150,30,150
set rtics 30
# aspect ration of plot (a circle should look circular)
set size square
plot t

Related

How to adjust the zcolor scale in a scatter plot in Matlab?

I have a data set, contained in three vectors say xx, yy and zz. I want to plot yy vs xx with the marker color face according to zz, so I use the scatter function such as:
scatter(xx,yy,50,zz,'s','filled')
Unfortunately zz has some very extreme values, so I cannot see any difference in the marker face color: all the dots are dark blue!
Is there a possibility to solve this issue? I was thinking of a possibility to impose a lower and an upper value for the color scale, so that any dot with a zz value out of the authorized range would be grey (or of the color of the closest bound)...?
Thank you for your help!
You can try changing the CLim property of the axes.
This example uses the MatLab example data seamount an changes the colorscale range
from the original [-4250 -490]
to the new [-1000 -100]
Default color scale
load seamount
figure
scatter(x,y,5,z)
colorbar
Modified color scale
figure
scatter(x,y,5,z)
set(gca,'clim',[-1000 -100])
colorbar
Default color scale
Nodified color scale

How can I plot the absolute value of a quantity with colorbar?

I am trying to figure out how to use colorbar to show the magnitude rather than the value. Currently colorbar has a range from [-x x] where any negative values are color blue-ish. I want the colorbar to ignore the sign values when determining what color to paint the graph.
I tried setting the range to [0 x] in CLim but that just paints anything that is negative blue.
An example would be plotting a sphere. If you plot a sphere, it would be centered
at the origin and the color would only reflect the value of the z-axis. However, I want the colorbar to show the magnitude of the distance from the center. So, in this case, the sphere should be a solid color representing the radius.
Any ideas?
You must take the magnitude of the data you are plotting (e.g. using the abs(data) function) prior to making a figure with it. Then, you can set the colorbar scale using the caxis([min max]) function.
Example:
rawData=repmat([-10:1:10],10,1);
figure(1),imagesc(rawData),caxis([0 10]) % All raw values below 0 are plotted as blue
magnData=abs(rawData) % Take absolute value of raw data
figure(2),imagesc(magnData),caxis([0 10]) % Raw negative values are now plotted in the same color as positive raw values (i.e. ignoring the sign, per the solution you requested).
Your solution (CLim) didn't work because setting the color range [0 x] will associate color of all values lower than 0 to the value of 0 (blue, in the case of the "jet" colormap).

Is there any way to change the xy positions in scatter graph in core plot

I am creating scatter graph, I need to change the x and y positions in scatter graph. Graph always starts with (0,0) positions but i need to show the starting points (7000, 800). Is there any way to change the x and y positions in scatter graph in core plot.
After showing the graph need to draw the line manually and get those values to search the properties.
Please help me.
Thanks in advance.
to set the point where the co-ordinates meet you have to set the orthogonal co-ordinate decimal
x.orthogonalCoordinateDecimal = CPTDecimalFromString(#"800");
y.orthogonalCoordinateDecimal = CPTDecimalFromString(#"740000");
and for setting the range of values to be plotted set the visibleRange for both the axes
These are features of the "plot space" in Core Plot. It defines the coordinate mapping between the plot area (basically the rectangle that contains all plot drawing) in data coordinates and the view in drawing coordinates. The xRange and yRange control the x and y range of the plot space, respectively.
The plot space converts coordinates in both directions—from data to view when drawing and from view to data when (for example) responding to touch events on a plot. See the plot space docs for a list of the available coordinate conversion methods.

Core Plot :Move only Data

I have created a scatter graph with three plot spaces. One for two y-axis each and one for the x-axis. I am able to show data for both y-axis. However now i want to move only the data,i.e. two line and not the two y-axis.Only the data and x-axis should move.
I have tried allowUserinteraction property. However is I enable it for x-axis, x axis moves without the data. If i enable it for both/either of axis, y axis also moves with data and scale of y-axis is not visible all the time. Can someone help pleas.e This is my first work with core plot.
I will add code if required.
Thanks
Since each plot space has both x and y ranges, I would just use two plot spaces for this situation. Use the same xRange for both plot spaces and assign the x-axis to one of them.
The easiest way to make them scroll only in the X direction is to set the globalYRange to the same range as the yRange for both plot spaces. Set allowsUserInteraction to YES for both plot spaces. If you need to change the yRange later, set the globalYRange to nil before you change the yRange and reset it afterwards. If you ever update the X range manually, be sure to always set it on both plot spaces.

How do you draw different surfaces with the same color scale in MATLAB?

I'm trying to represent several surface plots* for which the scale differs a bit. Each surface plot is drawn in a separate subplot and/or figure.
Right now, I'm using the default color mapping, which automatically scales the whole range of the color map to my figure, i.e. the maximum of my surface is always red (in 'jet' color mode) regardless of the magnitude of this maximum.
I'd like the colormap to be consistent between the figures instead of spread between the min and max of each individual graph. That way, readers could appreciate the difference in scale of the surfaces just by looking at the color map.
Any idea on how to do this?
**Actually, in case it makes a difference, I'm plotting results of a surface fitting operation using the plot command as follows:*
[myfit, gof] = fit( ... );
plot(fit)
You should use the caxis function. For example, if one surface has a height from 0 to 5 and the other has a height from 0 to 10, doing the following for both plots:
caxis([0 10]);
will force them both to use the same color scale as the plot that covers the larger range. You can also call caxis with an axes handle as the first argument:
caxis(hAxes, [0 10]); % Sets the color scaling for hAxes
If not specified, caxis adjusts the color scaling of the axes that is current.
I recently answered this question in video form on my blog:
http://blogs.mathworks.com/videos/2009/03/27/setting-the-colormap-to-be-consistent-across-axes/