Skip to main content
Better method for editing text item specifications
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

###Editing the text items (updated)

CellPrint[ExpressionCell[LocalSymbol["LabelsForScatterPlot"]CellPrint[ExpressionCell[InputForm @ LocalSymbol["LabelsForScatterPlot"], "Input"]]

raw_specspec

This looks funny, but it can be fixed by clicking on Cell > Convert To > StandardForm. After editing, it should look something like the following (I show one item label having been changed to have black text). Evaluate this cell to update your text item specifications.

edited_specedit

###Editing the text items

CellPrint[ExpressionCell[LocalSymbol["LabelsForScatterPlot"], "Input"]]

raw_spec

This looks funny, but it can be fixed by clicking on Cell > Convert To > StandardForm. After editing, it should look something like the following (I show one item label having been changed to have black text). Evaluate this cell to update your text item specifications.

edited_spec

###Editing the text items (updated)

CellPrint[ExpressionCell[InputForm @ LocalSymbol["LabelsForScatterPlot"], "Input"]]

spec

After editing, it should look something like the following (I show one item label having been changed to have black text). Evaluate this cell to update your text item specifications.

edit

Reorganized user instructions
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259
  • Interactively move text items in a panel displaying the plot and the text.

  • Edit the plot code and re-evaluate it without disturbing the positioning work already done on the text (textTool never modifies the plot you are working on).

  • Save the specification of the text items and their locations so you can take up work from where you left off after re-evaluating the plot or in a future Mathematica session.

  • Make snapshots of your work as you go. Each of these is printed in a new cell.

  • textTool requires two arguments.

textTool requires two arguments.

  • First argument

    The name of a local symbol (see LocalSymbol) where the text item specifications will be stored. In this case persistence is enabled. Arrangements of the text items will persist over re-evaluation of textTool in current session or in a future session.

    Or a list specifying the text items it is to display. The list takes the form {Text[...], Text[...], ..., Text[...]}. In this case persistence of the text items is disabled. Nonetheless, this can be useful in the early stages of text layout.

  • Second argument

    A graphics object which will form the background on which the text items will can be moved about.

User interface

  • Clicking to select a text item for dragging should be done near the center of the item. Otherwise, when two large items are close together, the one selected may not be the one intended. This can happen because the mouse cursor can be closer to center of one item even when it appears to be hovering over another.

  • textTool has three buttons.

  • Clicking on the Print button prints the textTool workspace contents in a new cell. This is not a raster image, but a full-fledged plot. It is the the tool's end-product. This is what you insert (by cut and paste) into any notebook or CDF as the fully labeled plot. You can even use it as an input for further processing (see Screen capture below).

  • Clicking on the Revert button restores the textTool workspace to the way it was when you started it or to when you did your last save.

Notes

  • If you modify your plot, you must evaluate your textTool expression to work with the modified plot. If the first argument is the name of a local symbol, all previous label positioning work will be preserved. They will also be preserved across sessions.

  • textTool uses a local symbol to store your labels between textTool sessions or between Mathematica sessions. Clicking of the Save button both updates the local symbol and updates the positions that the Revert button will use.

  • After modifying the plot, you must evaluate a textTool expression to work with the new plot. If the first argument is the name of a local symbol, all previous label positioning work will be preserved. They will also be preserved across sessions.

  • The directory where the text item specifications are stored can be found by evaluating $LocalSymbolBase. The file containing the specifications is a normal text file.

  • When the first argument given to textTool is an actual list of text items rather than a local symbol name, persistence will be disabled. If the Save button is clicked on, a message will be printed warning of this and giving the current locations of the text items, so not all will be lost. If these positions are valuable, they can be inserted into the code that created the list of Text objects.

    An example of this:

  • Interactively move text items in a panel displaying the plot and the text.

  • Edit the plot code and re-evaluate it without disturbing the positioning work already done on the text (textTool never modifies the plot you are working on).

  • Save the specification of the text items and their locations so you can take up work from where you left off after re-evaluating the plot or in a future Mathematica session.

  • Make snapshots of your work as you go. Each of these is printed in a new cell.

  • textTool requires two arguments.

  • First argument

    The name of a local symbol (see LocalSymbol) where the text item specifications will be stored. In this case persistence is enabled. Arrangements of the text items will persist over re-evaluation of textTool in current session or in a future session.

    Or a list specifying the text items it is to display. The list takes the form {Text[...], Text[...], ..., Text[...]}. In this case persistence of the text items is disabled. Nonetheless, this can be useful in the early stages of text layout.

  • Second argument

    A graphics object which will form the background on which the text items will can be moved about.

  • Clicking to select a text item for dragging should be done near the center of the item. Otherwise, when two large items are close together, the one selected may not be the one intended. This can happen because the mouse cursor can be closer to center of one item even when it appears to be hovering over another.

  • textTool has three buttons.

  • Clicking on the Print button prints the textTool workspace contents in a new cell. This is not a raster image, but a full-fledged plot. It is the the tool's end-product. This is what you insert (by cut and paste) into any notebook or CDF as the fully labeled plot. You can even use it as an input for further processing (see Screen capture below).

  • Clicking on the Revert button restores the textTool workspace to the way it was when you started it or to when you did your last save.

  • textTool uses a local symbol to store your labels between textTool sessions or between Mathematica sessions. Clicking of the Save button both updates the local symbol and updates the positions that the Revert button will use.

  • After modifying the plot, you must evaluate a textTool expression to work with the new plot. If the first argument is the name of a local symbol, all previous label positioning work will be preserved. They will also be preserved across sessions.

  • The directory where the text item specifications are stored can be found by evaluating $LocalSymbolBase. The file containing the specifications is a normal text file.

  • When the first argument given to textTool is an actual list of text items rather than a local symbol name, persistence will be disabled. If the Save button is clicked on, a message will be printed warning of this and giving the current locations of the text items, so not all will be lost. If these positions are valuable, they can be inserted into the code that created the list of Text objects.

    An example of this:

  • Interactively move text items in a panel displaying the plot and the text.

  • Edit the plot code and re-evaluate it without disturbing the positioning work already done on the text (textTool never modifies the plot you are working on).

  • Save the specification of the text items and their locations so you can take up work from where you left off after re-evaluating the plot or in a future Mathematica session.

  • Make snapshots of your work as you go. Each of these is printed in a new cell.

textTool requires two arguments.

  • First argument

    The name of a local symbol (see LocalSymbol) where the text item specifications will be stored. In this case persistence is enabled. Arrangements of the text items will persist over re-evaluation of textTool in current session or in a future session.

    Or a list specifying the text items it is to display. The list takes the form {Text[...], Text[...], ..., Text[...]}. In this case persistence of the text items is disabled. Nonetheless, this can be useful in the early stages of text layout.

  • Second argument

    A graphics object which will form the background on which the text items will can be moved about.

User interface

  • Clicking to select a text item for dragging should be done near the center of the item. Otherwise, when two large items are close together, the one selected may not be the one intended. This can happen because the mouse cursor can be closer to center of one item even when it appears to be hovering over another.

  • textTool has three buttons.

  • Clicking on the Print button prints the textTool workspace contents in a new cell. This is not a raster image, but a full-fledged plot. It is the the tool's end-product. This is what you insert (by cut and paste) into any notebook or CDF as the fully labeled plot. You can even use it as an input for further processing (see Screen capture below).

  • Clicking on the Revert button restores the textTool workspace to the way it was when you started it or to when you did your last save.

Notes

  • If you modify your plot, you must evaluate your textTool expression to work with the modified plot. If the first argument is the name of a local symbol, all previous label positioning work will be preserved. They will also be preserved across sessions.

  • textTool uses a local symbol to store your labels between textTool sessions or between Mathematica sessions. Clicking of the Save button both updates the local symbol and updates the positions that the Revert button will use.

  • The directory where the text item specifications are stored can be found by evaluating $LocalSymbolBase. The file containing the specifications is a normal text file.

  • When the first argument given to textTool is an actual list of text items rather than a local symbol name, persistence will be disabled. If the Save button is clicked on, a message will be printed warning of this and giving the current locations of the text items, so not all will be lost. If these positions are valuable, they can be inserted into the code that created the list of Text objects.

    An example of this:

corrected incorrect example of error message
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

msgmsg

msg

msg

Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259
Loading