Thursday, October 24, 2013

ListLinePlot with Controls to Improve Plot Readability

For good readability, as required by a journal, we need to change the look of a ListLinePlot and it can take a bit of fiddling. Here is a template I created that you can use. For publication, the best resolution seems to be given by saving as PDF, but PNG is also good. Although accepted by journals, TIFF doesn't seem to give sufficient resolution (e.g. 600 DPI). To give more separation between the PlotLabel and the y-axis label, add \n at the end of the PlotLabel to insert a newline.

I have shown the code in formal block indented style by inserting line returns after each command, and then Mathematica creates the indents at their proper level. This is a coding best practice. but I typically just leave mine as one continuous stream of commands.

Please note: If you copy and paste this code into your Notebook, the plot will look messed up until you click and drag a corner to expand it to the size you'd see in a journal. You can adjust the controls to work for a smaller size.

This is a plot of axon thresholds by the electrical stimulus strength on their surface that is required to fire them for various diameter axons. The stimulation is in 60 microsecond pulses, 5000 per second. Axons have little repeater stations to keep the signal going and electrical stimulation can trigger these repeaters. These are large- to medium-sized fibers that sense proprioception (muscle position) and fine-touch with a conduction velocity of 30 - 70 m/sec. The overall study is on high frequency stimulation of the spinal cord for pain relief.

ListLinePlot[
  {{5.7,.87},{7.5,.53},{8.7,.40},{10.0,.33},{11.5,.25},{12.8,.25},{14.0,.24}},
  Mesh->Full,
  MeshStyle->PointSize@Large,
  PlotStyle->Thick,
  TicksStyle->Large,
  PlotLabel->Style["Fiber Thresholds at Frequency = 5 KHz and 60 \[Mu]s Pulse Width",Large],
  AxesLabel->{Style["Fiber Diameter (\[Mu]m)",FontSize->18],   Style["Stimulus (nA)",FontSize->18]}
]


1 comment:

  1. Sir, would you please detail it more (or send the link) to include frame, frame labels, plotlegends etc.

    ReplyDelete