Message Boards Message Boards

GROUPS:

DateListPlot in webMathematica doesn't show FrameTicks properly

Posted 4 years ago
6036 Views
|
2 Replies
|
2 Total Likes
|

It seems that DateListPlot when used in webMathematica (3.3.1) show different output than in desktop Mathematica (10.1).

In desktop Mathematica, if you evalutate

data = {{{2015, 1}, 10}, {{2015, 2}, 6}, {{2015, 3}, 15}};
DateListPlot[data]

will show this picture:

desktop Mathematica output

in webMathematica instead, when you call this code (html removed for clarity) in .jsp file from your browser

 <msp:evaluate>
      data = {{{2015, 1}, 10}, {{2015, 2}, 6}, {{2015, 3}, 15}};
      MSPShow[DateListPlot[data]]
 </msp:evaluate>

it will show the graph without the vertical and horizontal Ticks:

webMathematica .jsp output

Then I've tried to add FrameTicks -> True (and Frame-> False otherwise it doesn't show them)

<msp:evaluate>
      data = {{{2015, 1}, 10}, {{2015, 2}, 6}, {{2015, 3}, 15}};
      MSPShow[
         DateListPlot[data
           ,Frame-> False
           ,FrameTicks -> True]]
    </msp:evaluate>

the output now shows the ticks, but in Scientific Notation. No way to display the ticks in date format:

enter image description here

It appears as a bug for me, because other functions as Plot[] or ListPlot[] produce a regular output. This strange behavior seems to be peculiar to DateListPlot[].

Does anyone has encountered the same problem or found a workaround?

(I've posted this question also on StackExchange )

2 Replies

I recognize this issue. I am affected by it too, but in my case I see it when I run my program from the Wolfram Script environment (I am not using webMathematica). Under 10.2 I always see the issue when running scripts, but under 10.3 the issue is not preset if the front end is not open.

I can run my script with my Mathematica Front End closed, but I don't think you can do that with webMathematica. I have contacted support and they have reproduced the problem [CASE:3450946].

My script runs automatically everyday in order to generate and email a report. Unfortunately I keep forgetting to close my Mathematica Front End and therefore my report is sometimes missing the ticks. I really would like to have a workaround this issue.

Posted 3 years ago

I've encountered the same problem with Mathematica v10.0 and .NETLink (evaluateToImage).

A "workaround" that's okay for me is to replace

PlotTheme->"Web"

with

Sequence@@DeleteCases[Charting`ResolvePlotTheme["Web", DateListPlot], 
 HoldPattern[FrameTicks -> _]]

I hope this helps.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract