Message Boards Message Boards

6 Replies
2 Total Likes
View groups...
Share this post:

Putting text on a graphic Plot that has a rotated label on the left

Posted 10 years ago

I have created some graphics for a scientific publication, but am having some trouble fine tuning them for the journal. More particularly I want to addtext to plots that have a rotated label at the left of the plot.

The Figure consists of a grid of 4 plots (2 rows of 2). I have proceeded as follows:

The first plot consists of a ListPlot of some data points, overlayed with a Plot of a fitted function. The fitted function is called inc7[parameters] evaluated using the best fit values of the parameters evaluated previously. I have chosen appropriate axes and fonts and there is a Label on the left that has been rotated to read vertically and that contains a superscript. Here is the command that created the first plot:

plot1 = Labeled[
    inc7[x, \[Tau]1, T1, M, \[Phi]1] /. nlm5["BestFitParameters"], {x,
      0, 85}, PlotRange -> All, ImageSize -> size,
    TicksStyle -> Directive[Black, 16],
    Ticks -> {Automatic, {{.00002, "2"}, {.00004, "4"}, {.00006,
        "6"}, {.00008, "8"}, {.00010, "10"}, {.00012, "12"}, {.00014,
        "14"}}}, AxesLabel -> {"Age", ""},
    LabelStyle -> Directive[Black, 16]],
  "Incidence x \!\(\*SuperscriptBox[\(10\), \(5\)]\)", Left,
  RotateLabel -> True, LabelStyle -> Directive[Black, 16]]

and the output produced is


So far so good! Now I want to display a grid of four such plots, so I try

Grid[{{plot1, plot2}, {plot3, plot4}}]

which produces the output


That also works OK. However I now want to put some l;abels on each of the four plots as well as some parameter values. I tried putting text on the first graphic (plot) using the drawing text tool. However this results in the left hand vertical label reverting to the generating expression. So I am unable to add text to the figure without destroying it. I have tried to insert the text on each of the 4 plots in the grid at an earlier stage, but without success. Is there a way to add text to plots at the same time as having a vertical label on the left?

Thanks for any assistance.


[huge not-human-readable outputs deleted. Please see for code formatting tools and consider attaching a notebook file when inputs or outputs are more than a few lines. - Moderation Team]

POSTED BY: perl hackett
6 Replies

Please edit your post using the formatting tools provided at the top of the posting area. Also, please delete the enormous code blocks that you have posted. I would like to read this post and understand your question but as it currently appears it is incomprehensible.

POSTED BY: David Reiss

We would like to see the Input code as code and then the displays as images. Here is a routine I wrote for my computer to export output displays to a specific location. I did it initially for Mathematica StackExchange, but it's all the same for Wolfram Commumity. You will have to make a folder In your $UserBaseDirectory for your Mathematica images and then alter the path to correspond to your system.

SEExport::usage = 
  "SEExport[type][graphic] exports the graphics as an image of the \
given type to a standard location from which it can be uploaded to a \
StackExchange posting. The types are JPEG, PNG or PDF. But it is \
better to Print PDF using Adobe Acrobat.";
SEExport[type : ("JPEG" | "PNG" | "PDF")][item_] :=
StackExchangePlots\\uploadGraphic.jpeg", item, "JPEG"],
  "PNG", Export[
StackExchangePlots\\uploadGraphic.png", item, "PNG"],
  "PDF", Export[
StackExchangePlots\\uploadGraphic.pdf", item, "PDF"]

Then save any output display with a name:

item = code that produces an output display

and Export the display with (say):


Then use the image button on the Wolfram Community input panel to retrieve the image from your computer and insert it into your posting.

You could use the Epilog option to add Text statements to each plot. Maybe that will be sufficient to do the job.

My Presentations application coverts most "Plot" statements to "Draw" statements making it easier and more natural to combine graphics primitives with the various curves and surfaces. But Epilog should do it.

Posted 10 years ago

Dear David and other respondents,

My apologies if I have posted in a non-readable format. I am obviously out of date with using the forum. The last time I posted it was to Mathgroup and it was the practice to copy only text from cells that could then be cut and pasted into Mathematica by respondents. No attachments or images were allowed.

As a result of helpful feedback from yourself and the forum organisers I have found the community posting instructions and tools. These look great! I will edit and repost my question in a better format in the next few days. I gather that editing the post will cause the posting history to be lost, but result in a better consultable resource for the Ma community.


POSTED BY: perl hackett
Posted 10 years ago

Dear respondents,

Thank you all for replying to my query and to the moderators for editing my post. I apologise for the form of the initial posting, which was appropriate to the text only Mathgroup forum to which I last posted some time ago. As a result of suggestions by David Park I have worked out a solution to my problem using Epilog and Prolog. I don't thinikk it is a great solution, due to my lack of expertise in all the options of the commands.

I am attaching a notebook that shows more clearly (with all of the commands and output) the problem I was referring to and a rough solution to it. I am still unsure of the best solution for preparing figures for publication, which often have to be resized or modified during the publication process. Most journals don't have access to Mathematica, so I assume figures have to be converted to .pdf or other formats. If there is a guide to figure preparation out there somewhere, that takes account of the fact that not everyone has Ma, I would be pleased to hear about it.


POSTED BY: perl hackett
Posted 10 years ago

Further to my previous post here is a revised example.nb with a typographical error (nlm5 should have been nlm1) corrected!


POSTED BY: perl hackett
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract