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 for Programming
 Forum for Origin C
 Axis Tick Label
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

newuser_ca

70 Posts

Posted - 08/14/2012 :  1:10:25 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 8.6 in win 7

Hi,

I have a plot with Date as X. I want to display date "8/8/2012" as "TEST". I used the following codes:
tr.Root.Labels.BottomLabels.Custom.Special.Type.nVal = 3;
tr.Root.Labels.BottomLabels.Custom.Special.Label.strVal = "TEST";
tr.Root.Labels.BottomLabels.Custom.Special.Value.dVal = 2456147; // 2456147 is Julian Day for 8/8/2012


However, I got it on the day "8/11/2012". I noticed that, date value "2456147" was translated "2.45615E6". It was rounded to "2456150". See attached picture.

How to solve this?

Question2:
I have a plot with Date as X axis. I want to display the date smart. the date range could be a few hours up to a few years. I think I could write a lot of "if" to define the increament value using:
tr.Root.Scale.IncrementBy.dVal = 0;
tr.Root.Scale.Value.dVal = SOMEVALUE;


but, when the user zoom in/out, the X-axis is very ugly. see post:
http://www.originlab.com/forum/topic.asp?TOPIC_ID=10552

So, I use another way:
tr.Root.Scale.IncrementBy.nVal = 1;
tr.Root.Scale.MajorticksCount.nVal = 7;


and X axis is not readable friendly:


Is there a way to display it smartly like only at the time "00:00" or "12:00". How to display 2 lines of X axis tick label?
See pictures below: (I did this in windows Paint, not from Origin. :))

Penn

China
644 Posts

Posted - 08/14/2012 :  11:28:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Q1:
This is a bug, and We will try to fix it. This problem is brought up by the scientific notation of the value. By default, Origin will convert the value into scientific notation when upper threshold power is 6. Now, the Julian value is converted, which make it rounded. The workaround is:
1. Click menu Tools: Options to open the Options dialog.
2. Go to the Numeric Format tab, set Upper Threshold Power to 8, or bigger.

Q2:
You can try

tr.Root.Scale.IncrementBy.dVal = 0;
tr.Root.Scale.Value.strVal = "0.5day";

When zoom in the graph, the labels will change accordingly, which will make the label not display at "00:00" and "12:00". Currently, it seems no way to display in two lines.

Penn
Go to Top of Page

newuser_ca

70 Posts

Posted - 08/16/2012 :  2:02:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot.
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