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
4
votes
1 answer

ggplot2 - annotate text with superscript

I want to add an R^2 value to my plot. I passed the label to geom_text() as follows; geom_text(aes(x,y,label=caption),parse=T, data.frame(x=-2,y=80,caption=("R^2=0.43")))) but it plots as =(R^2,0.43). Any ideas?
jslefche
  • 4,379
  • 7
  • 39
  • 50
4
votes
3 answers

I would like to print superscript and subscript with printf, like x¹?

I want to print out a polynomial expression in c but i don't know print x to the power of a number with printf
4
votes
1 answer

Inkscape: how to attach superscript and subscript to the same character

I want to add both superscript and subscript to the same character in the Inkscape text object. Currently, I have this: but I want apostrophe (') and 0 to be aligned vertically so that x has (') as superscript and 0 as subscript.
Hasan Balcı
  • 938
  • 7
  • 13
4
votes
1 answer

How to pass an expression to a geom_text label in ggplot?

I am attempting to pass an expression with subscript to a single geom_text() label in ggplot. Here is my code right now: my_exp <- expression('my_exp'[s][u][b]) my_data <- data.frame( var_1 = c("a", "b", "c"), var_2 = c(1, 2, 3) …
Reb Gray
  • 87
  • 1
  • 4
4
votes
1 answer

Is it possible to have scripts in

I have a drop down menu full of chemical elements. Is there any way I could format them properly? Ex: H2O
Shawn
  • 10,931
  • 18
  • 81
  • 126
4
votes
2 answers

How to display text with subscripts or superscripts in the Title Bar?

I would like to be able to show subscripted text in the Title Bar of a Windows Form or WPF Window. The reason for this is simple. Our project team has written a molecule editor: Instead of just displaying its name, 'ACME', we would like to show…
deadlyvices
  • 873
  • 6
  • 18
4
votes
1 answer

Swift subscript with argument label

Is it possible to create a subscript that can be invoked with explicit argument labels? struct MyType { subscript (label: Bool) -> String? { return nil } } let test = MyType() let value1 = test[true] // ok let value2 = test[label:…
jeremyabannister
  • 3,796
  • 3
  • 16
  • 25
4
votes
1 answer

Using a string variable in expression for R for subscript/superscript

We can use subscript or superscript in a plot title in R using the following plot(1,1, main=expression('title'^2)) #superscript plot(1,1, main=expression('title'[2])) #subscript However, what if I want to use a string variable in expression. For…
Brij Mohan
  • 45
  • 1
  • 3
4
votes
3 answers

Cannot assign through subscript to Swift String

I have a class that contains a name, an image, a dashed form of the name, and the length of the name. For example, I could have "dog", an image of a dog, "---", and name length 3. I just want to set name and pic for each object and have dashName…
SinaSB
  • 175
  • 2
  • 11
4
votes
1 answer

How can Swift Dictionaries be used to store generic objects [T : C]?

I am having difficulty using Swift Dictionaries to store generic objects. I am trying to stores objects in the following way: [C: Container], where C: ContentType Such that the dictionary is structured as below: Key Value --- …
Luke Fletcher
  • 348
  • 2
  • 12
4
votes
2 answers

Render sub/superscript in table (shiny)

I have a datatable in a shiny app, in which I want to add superscript to my observations. These should detail whether the observation is an estimate, and how far the year of the observation is from the reference year (this data is already in my…
4
votes
1 answer

C++ Inheritance Rules for Subscript Operator

I have a question regarding the subscript operator, overloading, and inheritance in C++. I'm pretty sure that if you have a parent class with multiple function overloads, it is possible for the child to override just one of the functions and inherit…
Mark
  • 175
  • 7
4
votes
1 answer

Why the type of "testScores["dave"]" is "Optional>.Type" instead of ">.Type"

I'm new to Swift and is trying to learn the concept of subscript. When I tried to find out the returned value of testScores["dave"], I was expecting Array.Type, however, the IDE instead outputted Optional>.Type. Why this is the case?…
Thor
  • 9,638
  • 15
  • 62
  • 137
4
votes
1 answer

How to include a string chain in a LaTeXed subscript in Python matplotlib

I want to write in the legend of a matplotlib figure a variable with a subscript using LaTeX. One possible code for this kind of problem could be: import numpy as np import matplotlib.pyplot as plt a, b = 1, 0 string = "({0},{1})".format(n,l) x =…
Hector248
  • 43
  • 5
4
votes
5 answers

Subscript digits from a string

I want to subscript every digits from string. For example : $str = '1Department of Chemistry, College of 2Education for Pure Science'; Output I want: 1Department of Chemistry, College of 2Education for Pure Science I fetched…
Nirali Joshi
  • 1,968
  • 6
  • 30
  • 50