Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am encountering really strange behavior: I wrote a function that plots values some data. After executing the code the resulting plot has the red 'error' colour, but only momentarily (maybe 0.1 sec). There is no error message, so the plot seems fine. However, when I export the graphic, the red colour is exported too. There seems no way to get the graphic without the red.

I am (in this case) not interested in what caused the error message but want to export the graphic without te red colour. Does anyone know how to do this? I tried using Quiet[] but that did not help.


My code:

 PlotBetaCI[whole_,everyminute_]:=
        Module[
        {len,linearmodels,betas,lows,highs},

        len=Length[everyminute];

        linearmodels=Quiet@LinearModelFit[Transpose[{#,whole}],x,x]&/@everyminute;

        betas=Transpose[{Range[len],#["ParameterConfidenceIntervalTableEntries"][[2,1]]&/@linearmodels}];

        lows=Transpose[{Range[len],#["ParameterConfidenceIntervalTableEntries"][[2,3,1]]&/@linearmodels}];

        highs=Transpose[{Range[len],#["ParameterConfidenceIntervalTableEntries"][[2,3,2]]&/@linearmodels}];

        ListPlot[{betas,Sequence@@Transpose[{lows,highs}]},Joined->{False,Sequence@@ConstantArray[True,len]},PlotStyle->Black,PlotMarkers->{Graphics[{Line[{{-1,-1},{1,1}}],Line[{{-1,1},{1,-1}}]},ImageSize->10],Sequence@@ConstantArray[Graphics[{Line[{{0,0},{0.04,0}}]},ImageSize->10],len]},ImageSize->Large,PlotRange->{Automatic,{Automatic,1.5}}]
    ]

The command to actually plot is (this produces the plot I am talking about)

PlotBetaCI[rmssd, everyminutermssd]

rmssd is a list of values. everyminutermssd has the same length, but depth 10.

share|improve this question
    
Can you show us the code? –  mfvonh Jun 23 at 14:02
    
The code is quite complicated and I think it is beyond the scope of the question. But I will add it anyway, for sake of completeness ;) –  A. Goossens Jun 23 at 14:05
    
Ok, by clicking fast enough on the 'error message plus sign' next to the graphic (believe me, that was difficult) I managed to track down the error and fix my code. However, I am still wondering if it is possible to export a graphic without the red error colour. –  A. Goossens Jun 23 at 14:20
    
I think you can't avoid finding out what caused the error ... if the red colour is only momentary, that probably indicates that you're using Dynamic or related things (directly or indirectly). Do you have any explicit dynamic things in that graphic? You can try right clicking the graphic and exporting like that too. (Though the quality won't be the same in version 9.) –  Szabolcs Jun 23 at 14:44
    
Can you post some example data (rmssd, everyminutermssd ), e.g. generated with random, to make the code complete and allow us to reproduce the problem? –  Szabolcs Jun 23 at 14:47

1 Answer 1

The pink box shows a formatting error. You can disable highlighting of formatting errors for a specific object using Style:

Style[
 Graphics[{Disk[], garbage}],
 AutoStyleOptions -> {"HighlightFormattingErrors" -> False}]

enter image description here

You can also change the setting globally using the Preferences dialog (Edit - Preferences - Messages - Formatting error indications), or just for the current session using:

SetOptions[$FrontEndSession,  AutoStyleOptions -> {"HighlightFormattingErrors" -> False}]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.