The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Colormap based on dates
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cpiano

Canada
4 Posts

Posted - 12/25/2013 :  6:59:10 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Version: 9.1.0 (64-bit) Sr1
Operating System: Win7
Hey everyone,
I have a 3D Scatter plot and I would like the balls to be color coded based on the date of occurrence. My dates are:
9/16/2003
9/2/2003
1/18/2006
3/18/2004
1/18/2006
1/18/2006
9/16/2003
1/18/2006
1/18/2006

I think the software changes the dates to numbers first and then does the color coding but the problem is that the legend is based on those numbers not real dates.
Is there anyway to have the legend show the dates not numbers?
Thanks a lot
PS. Marry Christmas BTW

Edited by - cpiano on 12/25/2013 6:59:47 PM

Kathy_Wang

China
159 Posts

Posted - 12/30/2013 :  01:18:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Not sure whether you mean "legend" or "color scale", but either way you probably need to manually change the display format of Julian date data. You could use the date2str function to convert Julian date to a string variable and form a new column with string, or change the display format with Dnn notations e.g.:


$(%(1, @WT, 5, 1), D0)
//Display the cell value in 5th column, 1st row as "MM/dd/yyyy" format


And you could refer to the help files for the manual control of legend and color scale for details.

Kathy
Originlab
Go to Top of Page

snowli

USA
1386 Posts

Posted - 12/30/2013 :  09:47:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

I saw your email in our TS account and have replied there with an examnple opj.

If in worksheet, you have XYZ columns and also a column with the date information.
Double click the date column and set the Format to Text.

Then in your 3D scatter plot, set the symbol color mapped to the date column.

The symbol with different dates will show different color.

Then you can right click the legend and choose Legend: Categorical Values to make dates and their corresponding symbol colors show in legend.


You can double click the text in legend to go into inplace edit mode and delete those legend entries you don't want.

Thanks, Snow Li
OriginLab Corp.

Go to Top of Page

greg

USA
1378 Posts

Posted - 12/30/2013 :  10:11:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If the text in your Date column is left-justified then Origin is treating these values as text blind to the fact that these are dates.

As text, you could set your Date column as Categorical, in which case Origin would assign "9/16/2003" a value of 1, "9/2/2003" a value of 2, etc. The second instance of "9/16/2003" would also have a value of 1 and all five instances of "1/18/2006" would have a value of 3.
You could then use color Indexing or Color Mapping and each unique date would be a unique color.

As text, Kathy's legend notation would not work and your legend should look like this (I used column 4 as date):
\l(1,1) %(1, @WT, 4, 1)
\l(1,2) %(1,@WT,4,2)
\l(1,3) %(1,@WT,4,3)
\l(1,4) %(1,@WT,4,4)

If the column is formatted as a Date column (see Column Properties) then the text would be right-justified and Origin would internally store a number which indicates that date.

As a Date value, you could only use Color Mapping for your color coding. Picking colors for each date would be difficult since you must know the internal value. If you add a column to your worksheet and copy the Date column values to this new column, you will see the internal values and you can then create Colormap Levels that show only these values and assign colors to those values.

Then Kathy's Legend notation would be useful as in this more complete example:
\l(1,1) $(%(1,@WT,4,1),D0)
\l(1,2) $(%(1,@WT,4,2),D0)
\l(1,3) $(%(1,@WT,4,3),D0)
\l(1,4) $(%(1,@WT,4,4),D0)
Go to Top of Page

cpiano

Canada
4 Posts

Posted - 01/03/2014 :  6:06:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you guys. It was a great help.
Also, many thanks to Snow for the email and the file. I used your advice and that problem is now solved.
I also have two more questions related to this.

1- My first question is that I want the radii to be based on a 5th column (these are microseismic magnitudes).

-1.58
-2.67
-2.86
-3.03
-2.19
-5
-2.36
-4.5
-2.46

The point is that I want the sizes to be in reverse order meaning that a -1 radius should be bigger than -5 radius. And I want this to be shown in the legend as well.
I figured to add a positive value to the 5th column and make the sizes based on this new column i.e.:

(+5.5)
3.92
2.83
2.64
2.47
3.31
0.5
3.14
1
3.04


but then the legend changes to the positive numbers as well.
Do you think if there is any solution for this?

2- Also, can I change the symbol for the size legend from white squares to spheres or other shapes? Once I add the size scaling, those spheres in the legend disappear and change to squares ...

Thank you so much
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000