Questions tagged [subscript]

A subscript is a number, figure, symbol, or indicator that is smaller than the normal line of type and is set slightly below the baseline.

Subscripts are common in mathematical notation (generally indicating position, such as the index of a variable in a vector) and chemistry formulas (e.g. H2O).

Subscript and superscript (Wikipedia)

625 questions
9
votes
4 answers

Superscript and Subscript in Android App XML

I am parsing data from an XML file which has subscript and superscript characters in them which I got from the character map. Like so: H₂ but when I display it on a textview in Android it gives me this…
xSooDx
  • 493
  • 1
  • 5
  • 19
8
votes
2 answers

Python negative subscripting

I'm currently reading Robert Sebesta's Concepts of Programming Languages, 10th edition (2012). In the chapter about data types, it reads "Ruby and Lua support negative subscripts, but Python does not". I thought negatives subscripts could be done in…
Felipe Cortez
  • 257
  • 3
  • 16
8
votes
2 answers

Error in `*tmp*`[[k]] : subscript out of bounds in R

I wanted to ask why I get this error while initializing a list of for example vectors or some other type and how can I fix it? > l <- list() > l[[1]][1] <- 1 Error in `*tmp*`[[1]] : subscript out of bounds This is the whole code I need, in fact I…
hora
  • 845
  • 5
  • 14
  • 25
7
votes
1 answer

Swift get vs _read

What's the difference between the following 2 subscripts? subscript(position: Int) { get { ... } } subscript(position: Int) { _read { ... } }
7
votes
1 answer

Why is the Swift compiler marking this as an error?

I have two ways of writing the same code, one of which seems to be disliked by the Swift compiler. Can you please explain why? Context: let guaranteedValue: String let cursorPositionFromEnd: Int Working code: let stringFromEndUntilCursorPosition =…
Fawkes
  • 3,831
  • 3
  • 22
  • 37
7
votes
1 answer

how to apply subscript in the facet_grid function of ggplot

I would like to use ggplot to plot my result of the association of air pollutant with birth weight changes (95%CI). the format of my data is like this variable exposure period coef coef_lb coef_ub PM10 entire pregnancy …
cyrusjan
  • 637
  • 1
  • 8
  • 23
7
votes
2 answers

How to include subscript in text for plot point labels

Hi I'm new to R so I apologise if this is a very basic question. I'm trying to add text to a plot at point 11 on the x axis and point 900 on the y axis that will read t0= -4.0280 with the 0 as subscript. Where t0 <- -4.0280 To do this I've…
JJS
  • 73
  • 1
  • 1
  • 4
7
votes
3 answers

How to add subscript characters in paragraphs using Word Automation?

I’m working on a program in C# that uses Microsoft Word 14.0 Object Library to create a .doc file, add paragraphs to it and saves it. There is a small form with a button that does described actions (see the code below). This part has no…
user1762820
  • 223
  • 3
  • 8
6
votes
1 answer

Run-time error '9': Subscript out of range - only when Excel VBE is closed

All, I am facing an error with a some VBA code in an Excel macro. Here’s the workflow I am attempting: I have a module that runs code to create a new worksheet, format it and add in a bunch of values within this same module, I determine a range of…
gg7aph
  • 161
  • 1
  • 1
  • 2
6
votes
1 answer

Subscript in multiple legends in ggplot2

To make my figure suitable for black-white printing, I mapped one variable with "shape", "lty", "color" together. ggplot(df, aes(x=time, y=mean, shape=quality, lty=quality, color=quality)) I got the…
Jellz
  • 435
  • 1
  • 7
  • 14
6
votes
1 answer

How to add text in superscript or subscript with python docx

In the python docx quickstart guide (https://python-docx.readthedocs.io/en/latest/) you can see that it is possible to use the add_run-command and add bold text to a sentence. document = Document() document.add_heading('Document Title', 0) p =…
viktortl
  • 63
  • 1
  • 5
6
votes
1 answer

Error while adding main title with subscript in gridExtra

I am trying to arrange a few plots generated by ggplot2using the gridExtra package. library(ggplot2) library(gridExtra) p1 <- ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point() p2 <- ggplot(iris, aes(Sepal.Length, Petal.Length)) +…
Crops
  • 5,024
  • 5
  • 38
  • 65
6
votes
1 answer

Is it possible to add "keyed-subscripting" to Class objects?

In the vein of... @implementation MyClass - (id) objectForKeyedSubscript:(id)k { return [self something:k]; } Is it also possible to "subscript" Class objects? I too, am about to find out, with you.. but thought I would post this…
Alex Gray
  • 16,007
  • 9
  • 96
  • 118
6
votes
5 answers

overloading assignment operator With subscript operator

I overloaded both subscript operator and assignment operator and I am trying to get right value to assignment operator example Array x; x[0]=5; by overloading subscript operator i can get value 0 but when i overload assignment operator it does the…
6
votes
1 answer

Using boost::shared_ptr with classes that overload the subscript operator ([])

I have a class that overloads the subscript operator: class SomeClass { public: int& operator[] (const int idx) { return someArray[idx]; } private: int someArray[10]; }; This of course allows me to access the array elements…
1 2
3
41 42